diff --git a/math.go b/math.go index 5c1346c..43bc996 100644 --- a/math.go +++ b/math.go @@ -2,6 +2,16 @@ package geom import "math" +// Abs returns the absolute value. +func Abs(f float64) float64 { + return math.Abs(f) +} + +// Abs32 returns the absolute value. +func Abs32(f float32) float32 { + return float32(Abs(float64(f))) +} + // IsNaN checks if the floating point number is not a number. func IsNaN(f float64) bool { return f != f