How can I turn on hardware execptions and trap them?
Posted on 2006-06-19
How can I turn on hardware exceptions? The test procedure of a cacluation library tries to force a floating point exception by throwing a whole slew of bogus numbers at the calculation functions. I want to trap, and find instances where this test procedure is successful in causing the calculation library to do something which is ordinarily a floating point exception; i.e. divide by zero, sqrt(-1), log(-100), asin (5), etc. etc.
Is there a way to turn these on, and for the test program to detect their occurrence. I just got bit by a divide by zero problem that was in the code and didn't show up until the code was run on another platform (the client's platform of course). I'd like to trap these errors on my system, MS Visual C++ .NET (currently 2003), in test mode, before the client sees them. Thanks in advance.