Added Abs{,32}.
This commit is contained in:
parent
45e7d0c8fd
commit
dd6d42a60a
10
math.go
10
math.go
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user