Usually, NaN shows up because of errors such as 0/0, so disabling it seems rather pointless (and philosophically related to the discussion here).
It would be nice if you told us why you're worried about NaN. In my experience NaN usually means somebody (usually the programmer) forgot to initialize a variable or forget to test for something akin to 0/0 or atan2(0,0). In other words, NaN is indicative of a problem that should be dealt with in application code, not papered over by turning off floating point exception handling.
Now, if you really, really, really need to disable NaN, I'd suggest writing a module to overload the arithmetic operators, as was done to handle arbitrarily long floats in Math::BigFloat, which you'll have to build with appropriate compiler options so that you, the programmer, can trap and deal with NaN.
Don't munge up Perl; write a custom arithmetic module which does NaN-less arithmetic.
emc
At that time [1909] the chief engineer was almost always the chief test pilot as well. That had the fortunate result of eliminating poor engineering early in aviation.
—Igor Sikorsky, reported in AOPA Pilot magazine February 2003.In reply to Re: Q: NaN again
by swampyankee
in thread Q: NaN again
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |