mirror of
https://github.com/rocky-linux/peridot.git
synced 2024-12-23 03:08:29 +00:00
17 lines
281 B
Go
17 lines
281 B
Go
//go:build go1.10
|
|
// +build go1.10
|
|
|
|
package sdkmath
|
|
|
|
import "math"
|
|
|
|
// Round returns the nearest integer, rounding half away from zero.
|
|
//
|
|
// Special cases are:
|
|
// Round(±0) = ±0
|
|
// Round(±Inf) = ±Inf
|
|
// Round(NaN) = NaN
|
|
func Round(x float64) float64 {
|
|
return math.Round(x)
|
|
}
|