Borland Floating-Point Initialization

Compilers from the Borland company report floating-point exceptions in a manner that is incompatible with Direct3D. To solve this problem, you should include a _matherr() exception handler like the following:

// Borland floating point initialization

#include <math.h>

#include <float.h>

void initfp(void)

{

// disable floating point exceptions

_control87(MCW_EM,MCW_EM);

}

int _matherr(struct _exception *e)

{

e; // dummy reference to catch the warning

return 1; // error has been handled

}