Added Max for floating point numbers.
This commit is contained in:
parent
060dd4380c
commit
b94290850e
10
math.go
10
math.go
@ -21,3 +21,13 @@ func NaN() float64 {
|
|||||||
func NaN32() float32 {
|
func NaN32() float32 {
|
||||||
return float32(NaN())
|
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)))
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user