Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 pondering the Monastery: (4)
As of 2015-07-04 03:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls