17 lines
205 B
Go
17 lines
205 B
Go
//go:build !go1.10
|
|
// +build !go1.10
|
|
|
|
package filter
|
|
|
|
import (
|
|
"math"
|
|
)
|
|
|
|
func mathRound(x float64) float64 {
|
|
t := math.Trunc(x)
|
|
if math.Abs(x-t) >= 0.5 {
|
|
return t + math.Copysign(1, x)
|
|
}
|
|
return t
|
|
}
|