in reply to Re: (ar0n) Re: How do I get a loop to recognize a number between $i and $i+1 (a decimal number)
in thread How do I get a loop to recognize a number between $i and $i+1 (a decimal number)

The theory behind ar0n's answer is to use integers inside your program and convert them to decimals when displaying them to the user.

In general, computers tend to be far better at handling integers than floating point (decimal) numbers. See Why am I getting long decimals (eg, 19.9499999999999) instead of the numbers I should be getting (eg, 19.95)? (part of perlfaq4) for a good explanation of why that is.

  • Comment on Re: Re: (ar0n) Re: How do I get a loop to recognize a number between $i and $i+1 (a decimal number)