We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 592312d commit 45f44e1Copy full SHA for 45f44e1
mgl32/util.go
@@ -137,7 +137,7 @@ func SetMax(a, b *float32) {
137
func Round(v float32, precision int) float32 {
138
p := float64(precision)
139
t := float64(v) * math.Pow(10, p)
140
- if t > 0 {
+ if t >= 0 {
141
return float32(math.Floor(t+0.5) / math.Pow(10, p))
142
}
143
return float32(math.Ceil(t-0.5) / math.Pow(10, p))
mgl64/util.go
@@ -139,7 +139,7 @@ func SetMax(a, b *float64) {
func Round(v float64, precision int) float64 {
return float64(math.Floor(t+0.5) / math.Pow(10, p))
144
145
return float64(math.Ceil(t-0.5) / math.Pow(10, p))
0 commit comments