Documentation
¶
Index ¶
- func AsInt[V Number](v V) int
- func AsInt64[V Number](v V) int64
- func AsUint[V Number](v V) uint
- func AsUint64[V Number](v V) uint64
- func Atoi(v interface{}) (number int)
- func Ceil[V Number](value, max V) V
- func Clamp[V Number](value, min, max V) V
- func Floor[V Number](value, min V) V
- func Round[V Decimal](x V) (rounded int)
- func RoundDown[V Decimal](value V) (rounded int)
- func RoundUp[V Decimal](value V) (rounded int)
- func ToFloat64(v interface{}, d float64) float64
- func ToInt(v interface{}, d int) int
- func ToInt64(v interface{}, d int64) int64
- func ToUint(v interface{}, d uint) uint
- func ToUint64(v interface{}, d uint64) uint64
- type Complex
- type Decimal
- type Integer
- type Integers
- type Number
- type UnsignedInteger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ceil ¶
func Ceil[V Number](value, max V) V
Ceil returns the value if it is less-than-or-equal-to the maximum and returns the maximum otherwise
func Clamp ¶
func Clamp[V Number](value, min, max V) V
Clamp returns the value if it is greater-than-or-equal-to the minimum and less-than-or-equal-to the maximum arguments; if the value is less than the minimum, the minimum is returned; if the value is greater than the maximum, the maximum is returned
func Floor ¶
func Floor[V Number](value, min V) V
Floor returns the value if it is greater-than-or-equal-to the minimum and returns the minimum otherwise
Types ¶
type Complex ¶
type Complex interface { ~complex64 | ~complex128 }
type Integers ¶
type Integers interface { Integer | UnsignedInteger }
type Number ¶
type Number interface { UnsignedInteger | Integer | Decimal }
Click to show internal directories.
Click to hide internal directories.