Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Decimal Array range

by sundialsvc4 (Monsignor)
on Dec 21, 2010 at 16:09 UTC ( #878295=note: print w/ replies, xml ) Need Help??


in reply to Decimal Array range

When you have a reasonably-sized range of real-numbered values, it is actually cleanest to simply define a list (or an array) of the actual values you want to use.

If the values represent known multiples of some base value, you can use an integer range and, within that range, do the necessary calculation.   Or, you might use a while loop, initializing the variable outside the loop and adding to its value at the end of the loop.

There are many ways to do it.   Pick one that is both abundantly-clear and easily maintainable.   Remember, “requirements change,” and you will not be (nor will you want to be...) in your present job forever.


Comment on Re: Decimal Array range

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (18)
As of 2014-07-24 16:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (162 votes), past polls