floor.go 263 B

12345678910111213141516
  1. // +build go1.10
  2. package sdkmath
  3. import "math"
  4. // Round returns the nearest integer, rounding half away from zero.
  5. //
  6. // Special cases are:
  7. // Round(±0) = ±0
  8. // Round(±Inf) = ±Inf
  9. // Round(NaN) = NaN
  10. func Round(x float64) float64 {
  11. return math.Round(x)
  12. }