|
|
|
|
|
by pavlov
1387 days ago
|
|
Direct3D used to flip the x87 FPU to single precision mode by default. This produced some amazing bugs when your other C libraries reasonably assumed that a double would be at least 64 bits. (The FPU mode settings affected the thread that called Direct3D, and most programs used to be single-threaded.) It seems they changed this behavior in Direct3D 10: https://microsoft.public.win32.programmer.directx.graphics.n... |
|
I was making a game using D3D, Lua and Chipmunk physics, and some of the behaviour of the game was being odd.
So I started to try printing random stuff with Lua, eventually I just tried: print(5+5), and to my surprise my console outputted "11".
I went into Lua's irc channel to talk about this, and everyone said I was nuts, that the number was too small to trigger precision issues, that I was a troll and so on.
After a lot of searching I found out about this D3D bug, so I switched the game to use OpenGL instead there it was, 5+5 = 10 again!
Now why fiddling with the FPU could make 5+5 become 11, I have no idea.