Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: Is the number before, in or after the interval? using spaceship operator <=>

by LanX (Archbishop)
on Nov 21, 2014 at 15:23 UTC ( #1108019=note: print w/replies, xml ) Need Help??


in reply to Re^2: Is the number before, in or after the interval? using spaceship operator <=>
in thread Is the number before, in or after the interval? using spaceship operator <=>

 ($_ > $r) - ($_ < $l)  

Should already do (can't test on Android :)

update

tested! =)

DB<41> sub tst { ($_ > $r) - ($_ < $l) } DB<42> $l=3;$r=6 => 6 DB<43> print tst(),"\t" for 0..9 => "" -1 -1 -1 0 0 0 0 1 1 1

Cheers Rolf

(addicted to the Perl Programming Language and ☆☆☆☆ :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2019-12-06 00:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (154 votes). Check out past polls.

    Notices?