notameadow has asked for the wisdom of the Perl Monks concerning the following question:
it gives:perl -e '$a = "-4.84900000E+001"; $a += 0; $b = -48.49; print "EQ\n" i +f ($a == $b); print "$a\n$b\n";'
All good. Now, try this:EQ -48.49 -48.49
gives:perl -e '$a = "-4.84800000E+001"; $a += 0; $b = -48.48; print "EQ\n" i +f ($a == $b); print "$a\n$b\n";'
? In my main code I am getting scientific notation values as strings, I add 0 and compare them as numbers. It all works, but not for -4.84800000E+001 (and 4.84800000E+001 too). Why? I tried some combinations like 37.37 and so on.-48.48 -48.48
I really do hope this is something silly on my part.perl -v This is perl 5, version 22, subversion 2 (v5.22.2) built for x86_64-li +nux-thread-multi (with 33 registered patches, see perl -V for more detail)
|
|---|