Board index » delphi » Invalid Floating Point Operation

Invalid Floating Point Operation

My app requires intensive number crunching, some of which is done in a
3rd-party DLL that parses and evaluates equations.  Seems to work fine.
I've put it through lots of tests, on my pc, under Win98.  No problems
or error messages, all bugs seem to be fixed.  Now I deploy to another
computer, running Win95.  I deploy both  by just installing the
executable and single DLL on the other computer, and by creating a setup
program via InstallShield.  In either case, when the app loads on the
other computer, I get the Windows message:  "Invalid Floating Point
Operation".  Sounds fatal.  But, after zapping the message, the app
continues to load, and performs flawlessly -- at least so far.

What's going on?  How do I troubleshoot it?  If the code really
contained an "invalid floating point operation", wouldn't the Delphi
compiler complain?  And if Delphi is happy, and my Win98 pc is happy,
why is the Win95 computer complaining?
One other bit of info:  most of my numbers, including results returned
by the DLL, are extended data types, not just double.

Thank, Ben Crain
bcr...@gmu.edu

 

Re:Invalid Floating Point Operation


: Ben Crain <bcr...@gmu.edu> wrote:

Quote
>What's going on?  How do I troubleshoot it?  If the code really
>contained an "invalid floating point operation", wouldn't the Delphi
>compiler complain?  

No. This is a runtime error condition, e.g. sqrt(-1).

Quote
>And if Delphi is happy, and my Win98 pc is happy,
>why is the Win95 computer complaining?

Good question. Some Microsoft DLLs (!) modify the FPU control word,
some OpenGL stuff shows unexpected behaviour.

Which versions of Delphi are you using?

--
Stefan Hoffmeister    (http://www.econos.de/)
No private email, please, unless expressly invited.

Re:Invalid Floating Point Operation


Hi,

Quote
>What's going on?  How do I troubleshoot it?  If the code really
>contained an "invalid floating point operation", wouldn't the Delphi
>compiler complain?  And if Delphi is happy, and my Win98 pc is happy,
>why is the Win95 computer complaining?
>One other bit of info:  most of my numbers, including results returned
>by the DLL, are extended data types, not just double.

Don't have time to test this, but I recall having same problems when
exporting my software from NT to 95 and also from 95 to NT. Problem was that
I had diffrent decimal separators in those computers dot / comma. When
compiling code with my NT having comma as decimal separator it worked fine
in NT but when it was exported to Win95 with dot as decimal separator it
gave me floating point errors. And vice versa.

So my suggestion would be to check out those computers international
settings that they have same decimal separators.

Mikko Isola

Re:Invalid Floating Point Operation


Quote
Stefan Hoffmeister wrote:
> : Ben Crain <bcr...@gmu.edu> wrote:

> >What's going on?  How do I troubleshoot it?  If the code really
> >contained an "invalid floating point operation", wouldn't the Delphi
> >compiler complain?

> No. This is a runtime error condition, e.g. sqrt(-1).

> >And if Delphi is happy, and my Win98 pc is happy,
> >why is the Win95 computer complaining?

> Good question. Some Microsoft DLLs (!) modify the FPU control word,
> some OpenGL stuff shows unexpected behaviour.

> Which versions of Delphi are you using?

Thanks for comments.  I'm using Delphi 4.  A runtime error like sqrt(-1)
could
occur within the DLL, or within my own code, which takes roots at various

places (though I've ensured a negative root cannot arise).  But Windows
can't know, upon loading the program, that such a runtime error will
occur, and it surely doesn't, in general, complain just because an
executable contains roots, etc.   Something else is going on, and I'm
still baffled.

Ben Crain
bcr...@gmu.edu

Re:Invalid Floating Point Operation


Quote
Ben Crain wrote:
> Operation".  Sounds fatal.  But, after zapping the message, the app
> continues to load, and performs flawlessly -- at least so far.

Of course, the band-aid fix is to wrap a try-except around it and just eat
the exception.  Not exactly a satisfying solution, but if it's 3rd party you
may not have any alternative.

Bob Lee

Re:Invalid Floating Point Operation


Quote
Ben Crain wrote in message <36D5848A.5C8EE...@gmu.edu>...

>Stefan Hoffmeister wrote:

>> : Ben Crain <bcr...@gmu.edu> wrote:

>> >What's going on?  How do I troubleshoot it?  If the code really
>> >contained an "invalid floating point operation", wouldn't the Delphi
>> >compiler complain?

>> No. This is a runtime error condition, e.g. sqrt(-1).

>> >And if Delphi is happy, and my Win98 pc is happy,
>> >why is the Win95 computer complaining?

I believe that this DELPHI IDE BUG occurs while debugging, especially when
stepping through the code with F7 and F8. The problem is lessened by having
fewer items in the Watch window.  Have you ever had your PC freeze if you
step through too rapidly? Pressing F7 quickly will freeze my PC often,
especially with lots of items in the Watch window.  The problem may be
exacerbated by using an F7 in the code.

IMO, until Imprise fixes this problem, tred softly with F7 and keep your
Watch windows small.

I've never had this bug unless the program was running under the IDE.

Re:Invalid Floating Point Operation


Quote
On Sat, 20 Feb 1999 22:33:46 -0500, Ben Crain <bcr...@gmu.edu> wrote:
>My app requires intensive number crunching, some of which is done in a
>3rd-party DLL that parses and evaluates equations.  Seems to work fine.
>I've put it through lots of tests, on my pc, under Win98.  No problems
>or error messages, all bugs seem to be fixed.  Now I deploy to another
>computer, running Win95.  I deploy both  by just installing the
>executable and single DLL on the other computer, and by creating a setup
>program via InstallShield.  In either case, when the app loads on the
>other computer, I get the Windows message:  "Invalid Floating Point
>Operation".  Sounds fatal.  But, after zapping the message, the app
>continues to load, and performs flawlessly -- at least so far.

>What's going on?  How do I troubleshoot it?  If the code really
>contained an "invalid floating point operation", wouldn't the Delphi
>compiler complain?  And if Delphi is happy, and my Win98 pc is happy,
>why is the Win95 computer complaining?
>One other bit of info:  most of my numbers, including results returned
>by the DLL, are extended data types, not just double.

>Thank, Ben Crain
>bcr...@gmu.edu

I have a database application that worked fine on my win95 machine but
when it ran on another win95 machine numbers that were supposed to be
integers were showing as floats.  So a customer number of 35 would
show 35.3454 or similar. the code worked fine under delphi 2 and only
produced errors when compiled under delphi4. After much tearing out of
hair it turned out that the second computer had a video card that used
an S3 chip and this was causing some major upsets.  I got the latest
drivers for the card from the net and once installed the app now works
fine. I see now that Inprise have released a v3 update for delphi 4
and have made an attempt to fix the S3 problem. I don't know whether
this will have anything to do with your problem but it's worth a look.

Other Threads