Added Max for floating point numbers.

This commit is contained in:
Sander Schobers 2018-09-23 09:42:08 +02:00
parent 060dd4380c
commit b94290850e

12
math.go
View File

@ -17,7 +17,17 @@ func NaN() float64 {
return math.NaN()
}
// NaN32 returns not a floating point number.
// NaN32 returns not a floating point number.
func NaN32() float32 {
return float32(NaN())
}
// 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)))
}