Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: (s)printf and rounding woes

by ysth (Canon)
on Nov 04, 2003 at 23:18 UTC ( [id://304570]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    for my $num ( 0 .. 101 ) {
       $num += 0.005;
       printf "%.2f\t%.20g\n", $num, $num;
    }
    
  2. or download this
    0.01    0.0050000000000000001041
    1.00    1.0049999999999998934
    ...
    14.01   14.005000000000000782
    15.01   15.005000000000000782
    16.00   16.004999999999999005
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://304570]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-19 20:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found