floating-point-exceptions

Enabling floating point interrupts on Mac OS X Intel

On Linux, feenableexcept and fedisableexcept can be used to control the generation of SIGFPE interrupts on floating point exceptions. How can I do this on Mac OS X Intel? Inline assembly for enabling floating point interrupts is provided in http://developer.apple.com/documentation/Performance/Conceptual/Mac_OSX_Numerics/Mac_OSX_Numeric...

what languages expose IEEE 754 traps to the developer ?

I'd like to play with those traps for educational purpose. A common problem with the default behavior in numerical calculus is that we "miss" the Nan (or +-inf) that appeared in a wrong operation. Default behavior is propagation through the computation, but some operation (like comparisons) break the chain and loose the Nan, and the res...

Floating Point Exception Caused By rand() In c++

I have an issue that I can't seem to solve. I am randomly generating numbers in order to determine if my numbers are relativity prime. Here is the function that gives me a Floating Point Exception: bool modularExponentiationTest(unsigned long long exponent, unsigned long long modulus) { short index = 0; unsigned long long base;...