Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > HELP: Floating point overflow (possible OT)

Reply
Thread Tools

HELP: Floating point overflow (possible OT)

 
 
Hamish Dean
Guest
Posts: n/a
 
      12-10-2003
Hi. To explain this, i'll list some relevant info:

Prog1: A c++ dll, written by me.
Prog2: A c++ dll, written by a 3rd party.
Prog3: A c++ application, written by me.
Prog4: A delphi 7 application, written by me.
Prog5: A delphi 4 application, written by someone else.

Prog1 calls a function from Prog2:

try{
DoSomething() /*call to Prog2*/
}
catch(...){};


Prog3,4,5 all call the same function from Prog1, with the same input
variables.

Prog3,4 both run successfully, no issues.

Prog5 says "Floating point overflow". This occurs somewhere in the
DoSomething function, which I obtained from a 3rd party.

Is this not an exception?? how come catch(...){} does not handle this?

I am stumped as to how to fix this. Any advice appreciated.

Hamish






I've written a .dll in c++ (ProgA). At some point, ProgA


 
Reply With Quote
 
 
 
 
David Fisher
Guest
Posts: n/a
 
      12-11-2003
"Hamish Dean" <(E-Mail Removed)> wrote:

> Prog5 says "Floating point overflow". This occurs somewhere in the
> DoSomething function, which I obtained from a 3rd party.
>
> Is this not an exception?? how come catch(...){} does not handle this?
>
> I am stumped as to how to fix this. Any advice appreciated.


Sounds like a hardware exception as opposed to a "C++ Exception" ...

Under UNIX you can catch them with signal(). I think Windows has a special
form of try / catch ("__try" ?) - look up "Structured Exception Handling"
(SEH) ...

David F


 
Reply With Quote
 
 
 
 
Marc Rohloff
Guest
Posts: n/a
 
      12-11-2003
"Hamish Dean" <(E-Mail Removed)> wrote in message news:<FaNBb.25435$(E-Mail Removed)>...

> Prog5 says "Floating point overflow". This occurs somewhere in the
> DoSomething function, which I obtained from a 3rd party.
>
> Is this not an exception?? how come catch(...){} does not handle this?
>
> I am stumped as to how to fix this. Any advice appreciated.


Hamish,

The first thing is that exception handlng doesn't work well across DLL
calls. So a try / catch doesn't usually help.

Your problem looks like it might have something to do with the
configuration of the 8087 (floating point processor) control word.

You can use a function like:

function Get8087CW: word;
asm
FStCW [Result]
end;

To retrieve the control word and check its value under each situation.
It is a bit mask so you may want to convert it to hex.

If you have problems post the results here.

Marc
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Share-Point-2010 ,Share-Point -2010 Training , Share-point-2010Hyderabad , Share-point-2010 Institute Saraswati lakki ASP .Net 0 01-06-2012 06:39 AM
floating point problem... floating indeed :( teeshift Ruby 2 12-01-2006 01:16 AM
converting floating point to fixed point H aka N VHDL 15 03-02-2006 02:26 PM
Fixed-point format for floating-point numbers Motaz Saad Java 7 11-05-2005 05:33 PM
floating point error: overflow? C. Sengstock C Programming 3 09-26-2003 06:29 AM



Advertisments