Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Dealing with Floating-point Exceptions in MSVC7\8

Learn how to catch floating-point exceptions in C\C++ code.


advertisement
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.


Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap