Fix overflow with high fixed-point magnitudes

This commit is contained in:
Rangi
2026-09-14 14:27:16 -04:00
parent d082f24a2d
commit ed1ac7309b
4 changed files with 18 additions and 4 deletions
+3
View File
@@ -3,15 +3,18 @@ println strfmt("%f", 1.999)
println strfmt("%f", 2.999)
println strfmt("%f", 3.999)
println strfmt("%f", 16777215.999)
println strfmt("%f", 4294967295.999)
opt Q16
println strfmt("%f", 1.999999)
println strfmt("%f", 2.999999)
println strfmt("%f", 3.999999)
println strfmt("%f", 65535.999999)
println strfmt("%f", 4294967295.999999)
opt Q24
println strfmt("%f", 1.999999999)
println strfmt("%f", 2.999999999)
println strfmt("%f", 3.999999999)
println strfmt("%f", 255.999999999)
println strfmt("%f", 4294967295.999999999)
+8 -2
View File
@@ -1,6 +1,12 @@
warning: Magnitude of fixed-point constant is too large [-Wlarge-constant]
at fixed-point-carry.asm(5)
warning: Magnitude of fixed-point constant is too large [-Wlarge-constant]
at fixed-point-carry.asm(11)
at fixed-point-carry.asm(6)
warning: Magnitude of fixed-point constant is too large [-Wlarge-constant]
at fixed-point-carry.asm(17)
at fixed-point-carry.asm(12)
warning: Magnitude of fixed-point constant is too large [-Wlarge-constant]
at fixed-point-carry.asm(13)
warning: Magnitude of fixed-point constant is too large [-Wlarge-constant]
at fixed-point-carry.asm(19)
warning: Magnitude of fixed-point constant is too large [-Wlarge-constant]
at fixed-point-carry.asm(20)
+3
View File
@@ -2,11 +2,14 @@
3.00000
4.00000
0.00000
0.00000
2.00000
3.00000
4.00000
0.00000
0.00000
2.00000
3.00000
4.00000
0.00000
0.00000