in reply to Re: Seeing if two numbers have the same sign
in thread Seeing if two numbers have the same sign

I was thinking about that! Convert to a string, and look to see if the first char is a "-" to determine sign. I don't think your routine works, though.
sub re { my $i=0; /-(?{$i=$i+1})/ for @_; $i=~/0|2/; }
given the same test cases as before,
xyxorNeg()spaceship()mult()anchor()re()
111111
-1101
1-101
-1-11111
And actually, its only twice as slow...
unit squarespaceshipmultiplylogicre
spaceship--------worse 21.74%worse 12.21%better 86.26%
multiplybetter 21.74%--------better 10.86%better 89.25%
logicbetter 12.21%worse 10.86%--------better 87.94%
reg expworse 86.26%worse 89.25%worse 87.94%--------