Closed ghost closed 3 years ago
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
}
@He11oLx 该问题在 #15 中进行修复,针对 precision
采用不同的算法。
如未报告其它类似问题,该问题将在一周后关闭。
RT