BUG: Round(169543.34596, -5) == 199999.99999999997, want 200000
opened this issue · comments
Deleted user commented
RT
Qi Yin commented
This is indeed a difference in accuracy, I continue to look for other algorithms to ensure his results.
package main
import (
"fmt"
"github.com/thinkeridea/go-extend/exmath"
)
func main() {
fmt.Println(exmath.Round(169543.34596, -5) == 200000.0) // false
fmt.Printf("%f\n", exmath.Round(169543.34596, -5)) // 200000.000000
fmt.Println(exmath.Round(169543.34596, -5)) // 199999.99999999997
}