Fix core:math/fixed.

This commit is contained in:
Jeroen van Rijn
2024-06-26 20:12:55 +02:00
parent 8d1827838f
commit c33bf7673f
2 changed files with 52 additions and 1 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ init_from_f64 :: proc(x: ^$T/Fixed($Backing, $Fraction_Width), val: f64) {
init_from_parts :: proc(x: ^$T/Fixed($Backing, $Fraction_Width), integer, fraction: Backing) {
x.i = fraction
x.i &= 1<<Fraction_Width - 1
x.i |= integer
x.i |= (integer << Fraction_Width)
}
to_f64 :: proc(x: $T/Fixed($Backing, $Fraction_Width)) -> f64 {