Board index » cppbuilder » Weird 'Invalid floting point operation' exception
Toby Biggs
![]() CBuilder Developer |
Weird 'Invalid floting point operation' exception2004-10-21 11:54:47 PM cppbuilder93 I hope someone has seen this before; I get a weird EInvalidOp exception ('Invalid floating point operation') in my program, on a line that has worked for months. Here is a snippet that causes the problem: __fastcall MyClass::MyClass() { DecimalSeparator = '.'; //<< added just in case double bias = 420.0; double test = bias / 60.0; //<< this is where the exception is thrown ... MyClass is the first class created in the project (it is autocreated), and so this is basically the first code run (at least the first code I wrote that is run). Sometimes the exception leaves for a (blissful) couple of hours, but invariably comes back, usually when I do a long compile (like when I change in important header file). However; if I turn off codeguard and debugging, everything seems to work fine, leading me to beleive it's got something to do with the de{*word*81}. Here are some things I've tried: - removing the line -- the exception still comes up, just later - delete the .tds and .csm files and rebuild -- no help - turn off debugging and codeguard -- works fine - add 'Set8087CS(0x133f);' before the offending line -- no help I hope anybody can offer assitance -- it's driving me up the wall. Thanks, Toby I'm using BCB5 by the way. |