use of control87 and floating point underflow

J

jobs239

In my c program if I put in the line
_control87(0, EM_ZERODIVIDE |_EM_UNDERFLOW);
I get a floating point underflow exception while running.

However if I change it to
_control87(EM_ZERODIVIDE |_EM_UNDERFLOW, EM_ZERODIVIDE |_EM_UNDERFLOW);
it runs fine.

Please help me undertsand whats wrong here and the correct use of
control87 function.
 
W

Walter Roberson

In my c program if I put in the line
_control87(0, EM_ZERODIVIDE |_EM_UNDERFLOW);
I get a floating point underflow exception while running.
However if I change it to
_control87(EM_ZERODIVIDE |_EM_UNDERFLOW, EM_ZERODIVIDE |_EM_UNDERFLOW);
it runs fine.
Please help me undertsand whats wrong here and the correct use of
control87 function.

control87() and _control87() are not part of the C standard. Please
consult a newsgroup more specific to the operating system in question.

My speculation, based upon the 87, is that you are doing something
specific to controlling floating point on the Intel floating point
units (80x87's).
 
J

jacob navia

(e-mail address removed) a écrit :
In my c program if I put in the line
_control87(0, EM_ZERODIVIDE |_EM_UNDERFLOW);
I get a floating point underflow exception while running.

However if I change it to
_control87(EM_ZERODIVIDE |_EM_UNDERFLOW, EM_ZERODIVIDE |_EM_UNDERFLOW);
it runs fine.

Please help me undertsand whats wrong here and the correct use of
control87 function.

In cases like this it would be a good idea to READ THE DOCS to
understand what are you doing.

http://msdn2.microsoft.com/en-us/library/e9b52ceh.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,690
Members
48,796
Latest member
Greg L.

Latest Threads

Top