Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: For loop wierdness

by Albannach (Prior)
on Oct 08, 2003 at 13:33 UTC ( #297580=note: print w/ replies, xml ) Need Help??


in reply to For loop wierdness

The good DrHyde is quite correct. Another alternative would be to use integers:

for(my $x = 0; $x <= 100; ++$x){ print $x/1000,"\n"; }
Your choice should depend on how much accuracy you really need, presuming that you will use $x in actual calculations, not just a list of values. I'd avoid the overhead of Math::BigFloat unless it was really necessary.

--
I'd like to be able to assign to an luser


Comment on Re: For loop wierdness
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (10)
As of 2015-07-08 07:51 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 (96 votes), past polls