Maybe the Math::MPFR/Math::MPC overloading of the arithmetic operators should warn about operations involving NaN's by default (at least if warnings are enabled) ... that would be quite a perlish thing to do!#!perl -swl use Math::MPFR qw(:mpfr); my $fr = Math::MPFR->new(); print $fr; warn "nan flag not set\n" unless Rmpfr_nanflag_p(); $fr *= 2; warn "nan flag set\n" if Rmpfr_nanflag_p(); print $fr; Rmpfr_clear_nanflag(); # Clear nan flag __END__ Outputs: @NaN@ nan flag not set nan flag set @NaN@
In reply to Re^4: NaNs are true
by syphilis
in thread NaNs are true
by syphilis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |