diff --git a/core/math/fixed/fixed.odin b/core/math/fixed/fixed.odin index e080d63b6..8567fd0ed 100644 --- a/core/math/fixed/fixed.odin +++ b/core/math/fixed/fixed.odin @@ -29,13 +29,13 @@ Fixed52_12 :: distinct Fixed(i64, 12) init_from_f64 :: proc(x: ^$T/Fixed($Backing, $Fraction_Width), val: f64) { - i, f := math.modf(val) + i, f := math.modf(math.abs(val)) x.i = Backing(f * (1< f64 { - res := f64(x.i >> Fraction_Width) - res += f64(x.i & (1<> Fraction_Width) + res += f64(num & (1<