Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Is this odd behavior a floating point problem?

by Eliya (Vicar)
on Mar 23, 2012 at 17:14 UTC ( #961266=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -e '$x=0.001; $sum += $x for 1..40; printf "%.20f", $sum/40'
    0.00100000000000000067
    
  2. or download this
    $ perl -e '$x=0.001; $sum += $x for 0..40; printf "%.20f", $sum/40'
    0.00102500000000000074
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2014-09-15 03:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (145 votes), past polls