I've configured Visual Studio to throw floating point exceptions via the _controlfp function. This works for NAN and INF, but not QNAN. I.e. Quiet NaNs don't cause an exception to be raised. Is there any function, or config option for Visual Studio 2008/2010, that will force QNANs to instead be NANs, so that they throw exceptions?
Some helpful tips, although I've never even remotely done something like this:
Read: http://www.cisl.ucar.edu/docs/trap.error/errortypes.html
The resulting search on the internet (which I've really only spent about 30 seconds on), leads me to believe that this is normally enabled with a compiler option.
However, I also seem to recall that such enabling/disabling of traps can be specified programmatically, and especially in windows, this can be done by pretty much any program, such as when a printer is used for printing. Additionally, if you change this option programmatically, please set it back to the previous value as soon as you can, otherwise if people from .NET try to use your code, they might have issues.
(In other words, your use of _controlfp could be overriden by some other routine, assuming that is indeed the correct approach to use)
Also see Visual Studio C++ 2008 / 2010 - break on float NaN
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With