Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: how do i test a number negative or positive?

by Kanji (Parson)
on Apr 09, 2002 at 22:25 UTC ( [id://157879]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    if ( $num == abs($num) ) {
        print "positive";
    } else {
        print "negative";
    }
    
  2. or download this
    if ( $num % 2 ) {
        print "odd";
    } else {
        print "even";
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-19 03:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found