Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Wrong calculations in for loop

by Anonymous Monk
on Aug 22, 2012 at 12:55 UTC ( #989020=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $zmax = 60;    # Maximum depth in your model
    my $dz = 0.05;    # Grid spacing in z-direction
    ...
    for (my $i=0; $i <= $zmax; $i = $i+$dz) {
       print $i."\n";
    }
    
  2. or download this
    3.6
    3.65
    3.69999999999999
    3.74999999999999
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2015-07-02 12:34 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 (36 votes), past polls