When calculating coordinates we should multiply at first otherwise we lose precision when i3 is compiled without sse2 support. The following code prints "Res1: 348 Res2: 349" when compiled with -O0 -mno-sse2 and "Res1: 349 Res2: 349" with -O0 -msee2. Note that -msse2 is default flag on 64bit OSes. int main() { double a = 349.0 / 768; double b = 349.0 * 768; int res1 = a * 768; int res2 = b / 768; printf("Res1: %d Res2: %d\n", res1, res2); return 0; } Thanks guys for helping me to hunt down this one.
Description
No description provided
Languages
C
58.6%
Perl
29%
Raku
9.4%
Ruby
1.2%
Shell
0.7%
Other
1.1%