Documentation
¶
Overview ¶
Package numbers implements various numerical functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DegreesToRadians ¶ added in v0.5.0
DegreesToRadians converts degrees to the equivalent in radians.
func MinMax ¶
MinMax returns the smallest and the largest value among the provided values. Returns (0, 0) if there are no values.
func MinMaxInts ¶ added in v0.5.0
MinMaxInts returns the smallest and the largest int value among the provided values. Returns (0, 0) if there are no values.
func RadiansToDegrees ¶ added in v0.5.0
RadiansToDegrees converts radians to the equivalent in degrees.
func Round ¶
Round returns the nearest integer, rounding half away from zero. Copied from the math package of Go 1.10 for backwards compatibility with Go 1.8 where the math.Round function doesn't exist yet.
func RoundToNonZeroPlaces ¶
RoundToNonZeroPlaces rounds the float up, so that it has at least the provided number of non-zero decimal places. Returns the rounded float and the number of leading decimal places that are zero. Returns the original float when places is zero. Negative places are treated as positive, so that -2 == 2.
Types ¶
This section is empty.