Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2015-10-06 23:16 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (163 votes), past polls