diff --git a/math.go b/math.go index 41eb240..05193cf 100644 --- a/math.go +++ b/math.go @@ -52,6 +52,16 @@ func NaN32() float32 { return float32(NaN()) } +// Round rounds to the nearest integer. +func Round(f float64) float64 { + return math.Round(f) +} + +// Round32 rounds to the nearest integer. +func Round32(f float32) float32 { + return float32(math.Round(float64(f))) +} + // Sq the square root of the value func Sq(f float64) float64 { return f * f