From 8febc0f526adecda6f8ae80f3869b7cd77e52984 Mon Sep 17 00:00:00 2001 From: Michael Fogleman Date: Tue, 28 Sep 2021 10:35:13 -0400 Subject: [PATCH] Fix rounding when converting to fixed precision --- util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.go b/util.go index 0806235..4497b7c 100644 --- a/util.go +++ b/util.go @@ -109,7 +109,7 @@ func fixp(x, y float64) fixed.Point26_6 { } func fix(x float64) fixed.Int26_6 { - return fixed.Int26_6(x * 64) + return fixed.Int26_6(math.Round(x * 64)) } func unfix(x fixed.Int26_6) float64 {