Added Abs{,32}.

This commit is contained in:
Sander Schobers 2018-11-14 10:15:53 +01:00
parent 45e7d0c8fd
commit dd6d42a60a

10
math.go
View File

@ -2,6 +2,16 @@ package geom
import "math" 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. // IsNaN checks if the floating point number is not a number.
func IsNaN(f float64) bool { func IsNaN(f float64) bool {
return f != f return f != f