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

Multiply it by a large factor and divide:
for my $n (0..100) { $n /= 100; # do something with a number between 0.00 and 1.00 }
or, for something more arbitrary:
for my $n (437 .. 1287) { $n /= 1000; # do something with a number between .437 and 1.287 }
update: the more i read the question, the less certain i am i know what you mean... hope this helps, though...

ar0n ]

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

Replies are listed 'Best First'.
Re: (ar0n) Re: How do I get a loop to recognize a number between $i and $i+1 (a decimal number)
by Kailua362 (Novice) on Jul 26, 2001 at 12:50 UTC
    Aloha, Mahalo for your reply. I am just a beginner. What I am trying to write is a script to correct an online quiz. It works fine for questions that have only one value. But I'm trying to get it to recognize that some questions have more than one value (because they may have dropdown boxes) What I thought I would do was give half credit if one of the two drop down boxes were correct. kailua362