
You can set and clear float exception flags directly with ieee-utils: http://hackage.haskell.org/packages/archive/ieee-utils/0.4.0/doc/html/Numeri... It looks like it needs a few tweaks to build with GHC 7, but even then that particularly module should still build fine. So before a complicated numeric calculation, clear the flags. Then, after forcing the result, check to see if any flags have been triggered and take appropriate action. This is more efficient than checking the flags after every operation anyway. Cheers, Sterl. On May 12, 2011, at 1:14 PM, Grigory Sarnitskiy wrote:
How do I make my program stop whenever it gets somewhere NaN as a result during a calculation? If there is no appropriate flag for ghc maybe there exist flags for C to use in optc.
I don't want NaN to propagate, it is merely stupid, it should be terminated.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe