Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CapacityOf ¶ added in v0.9.0
CapacityOf returns the comparable capacity of v.
For numeric values, it returns the numeric value itself.
For measurable values (arrays, slices, maps, strings, and channels), it returns their capacity.
The second return value reports whether v has a comparable magnitude.
func CompareCapacity ¶ added in v0.9.0
CompareCapacity compares the capacity of two numeric or measurable values.
Numeric values may be of different built-in numeric types. Measurable values (arrays, slices, maps, strings, and channels) are compared using their capacity.
It returns:
-1 if a < b 0 if a == b 1 if a > b
The second return value reports whether both operands could be compared. It is false if either value is neither numeric nor measurable, or if the comparison cannot be performed safely without losing numeric precision.
func CompareMagnitude ¶ added in v0.6.0
CompareMagnitude compares two numeric or measurable values.
Numeric values may be of different built-in numeric types. Measurable values (arrays, slices, maps, strings, and channels) are compared using their length.
It returns:
-1 if a < b 0 if a == b 1 if a > b
The second return value reports whether both operands could be compared. It is false if either value is neither numeric nor measurable, or if the comparison cannot be performed safely without losing numeric precision.
func FormatMessage ¶
FormatMessage processes the input arguments to return a formatted string. If the first argument is a string, it is treated as a format specifier. Otherwise, it returns a string representation of all arguments.
func MagnitudeOf ¶ added in v0.6.0
MagnitudeOf returns the comparable magnitude of v.
For numeric values, it returns the numeric value itself.
For measurable values (arrays, slices, maps, strings, and channels), it returns their length.
The second return value reports whether v has a comparable magnitude.
Types ¶
type Number ¶ added in v0.3.0
Number represents any built-in numeric type supported by this package.
It includes all signed and unsigned integer types, uintptr, and floating-point types.