Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: Range Operator in If Statement

by LanX (Canon)
on Jan 05, 2012 at 01:56 UTC ( #946313=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Range Operator in If Statement
in thread Range Operator in If Statement

When classifying by intervals, better try $case = int( ($ref-1) / 8 ) , so you only have to test for the results 0,1,2,3...

DB<104> for $ref (1,8,9,16,17,24,25,32) { print "$ref: ", int(($ref-1) +/8), "\n" } 1: 0 8: 0 9: 1 16: 1 17: 2 24: 2 25: 3 32: 3

Cheers Rolf


Comment on Re^3: Range Operator in If Statement
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2014-10-21 21:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (111 votes), past polls