Board index » delphi » D1: Invalid floating point error problem

D1: Invalid floating point error problem

Help!!                                                                    

I have an application that I have been developing under Delphi 1.0 that  
kepts generating "Invalid floating point error".  This error is not always
generated.   I have taken the code apart piece by piece and have yet to  
identify the source of the error.                                        

Does anybody have an suggestions?                                        

Frank Bradley
--------------------------------------------------------------------------
fbrad...@mfgcon.com                  | Manufacturing Concepts Incorporated
Mississauga, Ontario, Canada         | Helping Manufacturers Excel
--------------------------------------------------------------------------

 

Re:D1: Invalid floating point error problem


fbrad...@mfgcon.com  (Frank Bradley) wrote:

Quote
>Help!!                                                                    

>I have an application that I have been developing under Delphi 1.0 that  
>kepts generating "Invalid floating point error".  This error is not always
>generated.   I have taken the code apart piece by piece and have yet to  
>identify the source of the error.                                        

>Does anybody have an suggestions?                                        

        There is a de{*word*81} that would let you pin it down a little,
you know. Possibility: real-type variables are not automatically initialized
to 0. And one of the "valid" values for a real variable is NAN, or some such,
meaning not a number. So code like

var x,y:double;
begin
if x=y then

could generate an error or not, depending on whether x or y just happens
to be NAN.
        If this is it you could fix it by always explicitly initializing
real variables to 0 (or for that matter by not looking at them until
you've done something with them...)

--
David Ullrich
Don't you guys find it tedious typing the same thing
after your signature each time you post something?
I know I do, but when in Rome...

Re:D1: Invalid floating point error problem


fbrad...@mfgcon.com  (Frank Bradley) wrote:

Quote
>Help!!                                                                    

>I have an application that I have been developing under Delphi 1.0 that  
>kepts generating "Invalid floating point error".  This error is not always
>generated.   I have taken the code apart piece by piece and have yet to  
>identify the source of the error.                                        

>Does anybody have an suggestions?                                        

If it's an exception, try to snare it in a try/except that you narrow
down by halves at each trial.

If it's not an exception, what is it?
What does the de{*word*81} do when you step through code?

Regards,
Bengt Richter

Re:D1: Invalid floating point error problem


fbrad...@mfgcon.com  (Frank Bradley) wrote:

Quote
>Help!!                                                                    

>I have an application that I have been developing under Delphi 1.0 that  
>kepts generating "Invalid floating point error".  This error is not always
>generated.   I have taken the code apart piece by piece and have yet to >identify the source of the error.                                      
>                                                                        >Does anybody have an suggestions?                                        

At least a couple of us have had trouble with these errors in D1
when stepping through code using IEEE floating point types on
SX machines with no coprocessor. It appears to be a problem
between the Delphi de{*word*81} and the Windows floating point library
which is used in the absence of the coprocessor. The code seems
to _run_ fine, you just can't step through it.

--
Best wishes

John Nurick

e-mail: j.nur...@dial.pipex.com
v-mail: <+44|0> 191 281 1306

Re:D1: Invalid floating point error problem


In Delphi 2.0 the floating point state of the hardware is
left in an incorrect state on OLE calls. A friend of mine
discovered this problem and fixed it in the OLE interface
of the product he was working on.  

Delphi 1.0 may also leave the hardware state in an
inappropriate state.  

Other Threads