473,219 Members | 2,096 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,219 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 4710
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Vinny | last post by:
I have a few floating point questions/issues I wish to ask. An answer or discussion would be nice too :) Any links discussion the subject would be nice too.. 1. How do I generate an underflow...
4
by: Dave | last post by:
Hi folks, I am trying to develop a routine that will handle sphere-sphere and sphere-triangle collisions and interactions. My aim is to develop a quake style collision engine where a player can...
12
by: Dave Rahardja | last post by:
Does the C++ standard specify the behavior of floating point numbers during "exceptional" (exceptional with respect to floating point numbers, not exceptions) conditions? For example: double...
3
by: Mark L Pappin | last post by:
<puts on Compiler Vendor hat> I've recently discovered that our compilers don't make any attempt to handle floating point overflow in add/subtract/ multiply/divide, with the result that...
13
by: tings | last post by:
An article states: "In floating point maths, where if you divide by a sufficiently large number sufficiently often, you will always be able to reach a value too small to distinguish from zero,...
2
by: Benjamin Rutt | last post by:
Does anyone have C code laying around to do this? I have to read in some binary data files that contains some 4-byte IBM/370 floating point values. I would like a function to convert 4-byte...
13
by: Chris Stankevitz | last post by:
Hi, I have a very large Visual c++ .net 2003 7.1 native c application (approximately 500,000 lines of code). This application is a simulation that frequently works with floating point numbers....
9
by: Steven D'Aprano | last post by:
I'm looking for some way to get the next floating point number after any particular float. (Any mathematicians out there: I am aware that there is no "next real number". But floats are not real...
23
by: ultimatewarrior | last post by:
Hi all, first of all I beg your pardon if this question has been asked before, but I was unable to find anything in the past posts. I have written a piece of code that was supposed to be quite...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.