Documentation ¶
Overview ¶
Package branchless provides branchless operations on integers.
Index ¶
- func Abs(x int) int
- func Clamp(x, min, max int) int
- func Diff(x, y int) int
- func Equal(x, y int) int
- func GreaterThan(x, y int) int
- func GreaterThanEqualTo(x, y int) int
- func IsDivisibleBy(x, y int) int
- func IsEven(x int) int
- func IsNegative(x int) int
- func IsNotZero(x int) int
- func IsOdd(x int) int
- func IsPositive(x int) int
- func IsPowerOfTwo(x int) int
- func IsZero(x int) int
- func LessThan(x, y int) int
- func LessThanEqualTo(x, y int) int
- func Max(x, y int) int
- func MaxZeroAnd(x int) int
- func Min(x, y int) int
- func Negate(x int) int
- func NotEqual(x, y int) int
- func Sign(x int) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GreaterThanEqualTo ¶
GreaterThanEqualTo returns 1 if x >= y, otherwise 0.
func IsDivisibleBy ¶
IsDivisibleBy returns 1 if x is divisible by y, otherwise 0.
func IsPowerOfTwo ¶
IsPowerOfTwo returns 1 if x is a power of 2 (or is zero), otherwise 0.
func LessThanEqualTo ¶
LessThanEqualTo returns 1 if x <= y, otherwise 0.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.