Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromBool ¶
FromBool returns a 1 if the bool is true and a 0 for false. Typically the type parameter cannot be inferred and must be provided. See SetFromBool for a version that uses a pointer to the destination which avoids the need to specify the type parameter.
func SetFromBool ¶
SetFromBool converts a bool into a number, using generics, setting the pointer to the dst destination value to a 1 if bool is true, and 0 otherwise. This version of FromBool does not require type parameters typically.
Types ¶
type Complex ¶
type Complex interface { ~complex64 | ~complex128 }
Complex is a constraint that permits any complex numeric type. If future releases of Go add new predeclared complex numeric types, this constraint will be modified to include them.
type Float ¶
Float is a constraint that permits any floating-point type. If future releases of Go add new predeclared floating-point types, this constraint will be modified to include them.
type Integer ¶
Integer is a constraint that permits any integer type. If future releases of Go add new predeclared integer types, this constraint will be modified to include them.
type Number ¶
Number is a constraint that permits any single-valued numerical type, i.e., Integer or Float. It excludes complex numbers.
type Ordered ¶
Ordered is a constraint that permits any ordered type: any type that supports the operators < <= >= >. If future releases of Go add new ordered types, this constraint will be modified to include them.