lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> Isn't this a Windows problem rather than a Lua problem?  The problem
> being that various libraries secretly like to change the Floating Point
> Control register and don't always change it back.  You know the kind of
> thing, you call a DirectX function which calls some dodgy "high
> performance" graphics driver and now all of your NaNs are signalling
> and the floating point exceptions are of the non-useful kind.  Or your
> rounding mode has changed.

Yes, DX exhibits this problem, but Lua brings it out all on its own in
certain situations!  I have confirmed many times that calling into Lua and
manipulating some Lua Numbers can cause the denormals and precision to
change.  We have to wrap all calls into and out of Lua with _fpreset,
_control87 to keep it working correctly in all situations.