P is for Practical | |
PerlMonks |
Re: (s)printf and rounding woesby Zaxo (Archbishop) |
on Nov 04, 2003 at 22:34 UTC ( [id://304561]=note: print w/replies, xml ) | Need Help?? |
That is a general property of binary floating-point numbers. The difficulty will show up in any language. If you need consistency in a fixed-point decimal representation, you should scale the numbers to be represented as integers. After Compline,
In Section
Seekers of Perl Wisdom
|
|