Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2017-01-18 10:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (161 votes). Check out past polls.