gam3 has asked for the wisdom of the Perl Monks concerning the following question:
Can anyone explain to me why 0.0001 is stringified as "0.0001" but 0.00001 is stringified as "1e-05"?
This would make sense if "100000.0" was printed as 1e05, but is seems negative exponents are treated in a different and rather arbitrary way.
print 0.0001, " ", 0.00001, "\n"
-- gam3
A picture is worth a thousand words, but takes 200K.
A picture is worth a thousand words, but takes 200K.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Stringification of FP numbers.
by ikegami (Patriarch) on Jun 12, 2009 at 15:57 UTC | |
Re: Stringification of FP numbers.
by JavaFan (Canon) on Jun 12, 2009 at 16:24 UTC | |
Re: Stringification of FP numbers.
by ig (Vicar) on Jun 12, 2009 at 17:26 UTC | |
by gam3 (Curate) on Jun 14, 2009 at 18:51 UTC | |
Re: Stringification of FP numbers.
by syphilis (Archbishop) on Jun 12, 2009 at 23:58 UTC |
Back to
Seekers of Perl Wisdom