OpenGL and Borland Compilers – the _control87() catch
Borland compilers, by default, tell the FPU to generate floating point exceptions, this can lead to all sorts of problems when linking to libraries that doesn’t expect this behaviour. And that is the case with OpenGL.
The standard advice is to use _control87(MCW_EM, MCW_EM) to disable floating point exceptions.
The above advice does work, but there is a catch, a bug in Borland compilers that resets the floating point control word to _default87 when an exception is thrown (it would be fine if the _default87 value was set correctly by the _control87() call, but that is not the case).
Among other things, the wrong _default87 value reduces the FPU precision and your double precision floating point variables start behaving like single precision ones (but not until your application raises the first exception – arghh!).
From Borland Embarcadero Quality Central:
Workarounds
after any call to _control87 you can use the following line of code to set _default87 to the current control word:
_control87(_control87(0,0),0x1FFF);
Links:
http://qc.embarcadero.com/wc/qcmain.aspx?d=32483