floor.go 281 B

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