Keep It Simple, Stupid | |
PerlMonks |
Strange (rounding?) problemby gildir (Pilgrim) |
on May 02, 2001 at 13:56 UTC ( [id://77275]=perlquestion: print w/replies, xml ) | Need Help?? |
gildir has asked for the wisdom of the Perl Monks concerning the following question:
Fellow monks, I encountered a problem, that looks very strange at first glance: This code will produce these results: 739.3, 739.3 and false. So we modified the last line of code: There was a meaningful result: 1.13686837721616e-13 Now I understand that these two numbers are in fact different, but why does warn $number display the wrong (rounded) value? How can I control this behavior of warn? What I was trying to achieve is a warning message like 'The numbers X and Y are different!' but it looks more than little stupid to display message 'The numbers 739.3 and 739.3 are different!'.
Back to
Seekers of Perl Wisdom
|
|