in reply to Re: Floating point issue
in thread Floating point issue

Actually not. Just googled it... Thanks for the hint.

But what made me get confused was that it happened sometimes and wanted to know why.

Replies are listed 'Best First'.
Re^3: Floating point issue
by pryrt (Abbot) on Aug 12, 2016 at 22:09 UTC

    Depending on your starting value, sometimes the little tiny differences round to a value that Perl's default stringification will print differently than your expected precision, and sometimes they won't.

    If you want consistent precision in output, use sprintf or printf