Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Seeing if two numbers have the same sign

by WoodyWeaver (Monk)
on Jan 10, 2008 at 23:18 UTC ( [id://661753]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub andNeg {
      return (($_[0]^$_[1]) < 0);
    }
    
  2. or download this
    print "<table border>\n<tr><td>", join("</td><td>", "x", "y", "andNeg(
    +)", "spaceship()", "mult()", "anchor()"), "</td></tr>\n";
    for (0..3) {
    ...
      print "<tr><td>", join("</td><td>", $x, $y, andNeg($x, $y), spaceshi
    +p($x, $y), mult($x, $y), anchor($x, $y)), "</td></tr>\n";
    }
    print "</table>\n";
    
  3. or download this
    sub spaceship {
      (0 <=> $_[0]) == (0<=> $_[1]);
    ...
      }
      return 0;
    }
    
  4. or download this
    #!perl -w
    #
    ...
      }
      return @retval;
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-18 04:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found