Alex <perl5-porters@perl.org> writes: ># New Ticket Created by Alex ># Please include the string: [perl #24092] ># in the subject line of all future correspondence about this issue. ># <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=24092 > > > >Hello guys, > >I try to round 1.045 on my Perl (v5.6.1) but output is very strange: >perl -e "print sprintf('%.2f', '1.045')" But: perl -e "print sprintf('%.20f', '1.045')" 1.04499999999999992895 The boundary is drawn an 5 in next digit down so that falls under it. >1.04 >perl -e "print sprintf('%.2f', '1.0451')" >1.05 >Is it the bug? >Thanks. > >--- >AlexThread Previous | Thread Next