Board index » cppbuilder » Weird 'Invalid floting point operation' exception

Weird 'Invalid floting point operation' exception


2004-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.
 
 

Re:Weird 'Invalid floting point operation' exception

For what it is worth, I'm having the exact same problems and turning off the
integrated de{*word*81} is the only thing that has "solved" the problem so far.
After searching all over the web/newsgroups for a couple of days, I can see
that there are around a handful of people who have seen this, but nobody has
reported any consistent explanation or solution to the problem.
BTW, this is the reply from Borlands tech support. Don't know if I should
cry or laugh...
Thank you for contacting the Borland EMEA Support Center.
Your company does not have any technical support contract and I am afraid
that we no longer provide technical assistance for the product version that
you are running. I suggest instead that you consider consulting the Borland
Public Newsgroups and the Borland Developers Network Knowledge-Base. A vast
amount of information can be obtained from these free resources of
information
If you find a solution, please let me know.
Best regard,
Allan Hansen
"Toby Biggs" < XXXX@XXXXX.COM >wrote in message
Quote
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.