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 examining the Monastery: (5)
As of 2016-04-30 03:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    :nehw tseb si esrever ni gnitirW







    Results (441 votes). Check out past polls.