2018-09-22 16:12:34 +00:00
|
|
|
package geom
|
|
|
|
|
|
|
|
import "math"
|
|
|
|
|
|
|
|
// IsNaN checks if the floating point number is not a number.
|
|
|
|
func IsNaN(f float64) bool {
|
|
|
|
return f != f
|
|
|
|
}
|
|
|
|
|
|
|
|
// IsNaN32 checks if the floating point number is not a number.
|
|
|
|
func IsNaN32(f float32) bool {
|
|
|
|
return f != f
|
|
|
|
}
|
|
|
|
|
|
|
|
// NaN returns not a floating point number.
|
|
|
|
func NaN() float64 {
|
|
|
|
return math.NaN()
|
|
|
|
}
|
|
|
|
|
2018-09-23 07:42:08 +00:00
|
|
|
// NaN32 returns not a floating point number.
|
2018-09-22 16:12:34 +00:00
|
|
|
func NaN32() float32 {
|
|
|
|
return float32(NaN())
|
|
|
|
}
|
2018-09-23 07:42:08 +00:00
|
|
|
|
|
|
|
// Max the maximum of the two values.
|
|
|
|
func Max(a, b float64) float64 {
|
|
|
|
return math.Max(a, b)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Max32 the maximum of the two values.
|
|
|
|
func Max32(a, b float32) float32 {
|
|
|
|
return float32(math.Max(float64(a), float64(b)))
|
|
|
|
}
|