471,850 Members | 861 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,850 software developers and data experts.

use of control87 and floating point underflow

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.

Aug 23 '06 #1
2 4630
In article <11*********************@i3g2000cwc.googlegroups.c om>,
<jo*****@hotmail.comwrote:
>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).

--
"law -- it's a commodity"
-- Andrew Ryan (The Globe and Mail, 2005/11/26)
Aug 23 '06 #2
jo*****@hotmail.com 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

Aug 23 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Vinny | last post: by
12 posts views Thread by Dave Rahardja | last post: by
3 posts views Thread by Mark L Pappin | last post: by
13 posts views Thread by tings | last post: by
13 posts views Thread by Chris Stankevitz | last post: by
9 posts views Thread by Steven D'Aprano | last post: by
23 posts views Thread by ultimatewarrior | last post: by
reply views Thread by YellowAndGreen | last post: by
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.