-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Eng Zer Jun <[email protected]>
- Loading branch information
Showing
5 changed files
with
25 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Constraints type from https://github.com/golang/exp/blob/1829a127f884df39fc2eaf7e0dfc760648098768/constraints/constraints.go. | ||
package mathx | ||
|
||
// Signed is a constraint that permits any signed integer type. | ||
type Signed interface { | ||
~int | ~int8 | ~int16 | ~int32 | ~int64 | ||
} | ||
|
||
// Unsigned is a constraint that permits any unsigned integer type. | ||
type Unsigned interface { | ||
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr | ||
} | ||
|
||
// Integer is a constraint that permits any integer type. | ||
type Integer interface { | ||
Signed | Unsigned | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters