in reply to Re^3: NaNs are true
in thread NaNs are true

my $x;
$x *= 2;

Use of uninitialized value $x in multiplication (*) at ...


Good analogy. With the mpfr library (as with perl), such an operation does not cause a fatality - but a warning *is* provided (if the program explicitly looks for it) in that the nan flag is set:
#!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@
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!

Cheers,
Rob