Documentation ¶
Index ¶
- func ToInt[C IConvertable](i C) int
- func ToInt16[C IConvertable](i C) int16
- func ToInt32[C IConvertable](i C) int32
- func ToInt64[C IConvertable](i C) int64
- func ToInt8[C IConvertable](i C) int8
- func ToUint[C IConvertable](i C) uint
- func ToUint16[C IConvertable](i C) uint16
- func ToUint32[C IConvertable](i C) uint32
- func ToUint64[C IConvertable](i C) uint64
- func ToUint8[C IConvertable](i C) uint8
- type IConvertable
- type IFloat
- type IInteger
- type INumber
- type ISignedInteger
- type IUnsignedInteger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToInt ¶
func ToInt[C IConvertable](i C) int
ToInt attempts to convert any IConvertable value to an int. If the conversion results in a value outside the range of an int, the closest boundary value will be returned.
func ToInt16 ¶
func ToInt16[C IConvertable](i C) int16
ToInt16 attempts to convert any IConvertable value to an int16. If the conversion results in a value outside the range of an int16, the closest boundary value will be returned.
func ToInt32 ¶
func ToInt32[C IConvertable](i C) int32
ToInt32 attempts to convert any IConvertable value to an int32. If the conversion results in a value outside the range of an int32, the closest boundary value will be returned.
func ToInt64 ¶
func ToInt64[C IConvertable](i C) int64
ToInt64 attempts to convert any IConvertable value to an int64. If the conversion results in a value outside the range of an int64, the closest boundary value will be returned.
func ToInt8 ¶
func ToInt8[C IConvertable](i C) int8
ToInt8 attempts to convert any IConvertable value to an int8. If the conversion results in a value outside the range of an int8, the closest boundary value will be returned.
func ToUint ¶
func ToUint[C IConvertable](i C) uint
ToUint attempts to convert any IConvertable value to an uint. If the conversion results in a value outside the range of an uint, the closest boundary value will be returned.
func ToUint16 ¶
func ToUint16[C IConvertable](i C) uint16
ToUint16 attempts to convert any IConvertable value to an uint16. If the conversion results in a value outside the range of an uint16, the closest boundary value will be returned.
func ToUint32 ¶
func ToUint32[C IConvertable](i C) uint32
ToUint32 attempts to convert any IConvertable value to an uint32. If the conversion results in a value outside the range of an uint32, the closest boundary value will be returned.
func ToUint64 ¶
func ToUint64[C IConvertable](i C) uint64
ToUint64 attempts to convert any IConvertable value to an uint64. If the conversion results in a value outside the range of an uint64, the closest boundary value will be returned.
func ToUint8 ¶
func ToUint8[C IConvertable](i C) uint8
ToUint8 attempts to convert any IConvertable value to an uint8. If the conversion results in a value outside the range of an uint8, the closest boundary value will be returned.
Types ¶
type IConvertable ¶
type IConvertable interface { INumber }
IConvertable is an alias for everything that can be converted
type IInteger ¶
type IInteger interface { ISignedInteger | IUnsignedInteger }
IInteger is an alias for the all unsigned and signed integers
type ISignedInteger ¶
ISignedInteger is an alias for all signed integers: int, int8, int16, int32, and int64 types.