
ecause the scientific and engineering numeric floating-point calculation approximates real arithmetic, the precision of this format can create situations wherein your floating-point operations results are not acceptable in some domains. A programming error can create some pretty sticky exceptional situations, but this is also a byproduct of the nature of the domain itself. You can find a numerous discussions on different software implementation techniques for dealing with arithmetic floating-point exceptions. Some solutions are slower, others are faster. Some of them prevent occurrences of exceptions, other respond to exceptions.
This article is the result of a study on how to take advantage of what is available in Microsoft's implementation of C\C++ in VS2003 and VS2005 for the latest x86-based platform that supports IEEE Standard 754 for Binary Floating-Point Arithmetic.
You'll learn how to:
- Enable the floating-point exceptions of your interest.
- Trap them.
- Set the Visual Studio compiler options.