print+('equal','a is smaller','b is smaller')[length($a-$b)-length($b-$a)];
or
print 1x($a-$b)?'b is smaller':1x($b-$a)?'a is smaller':'equal';
In reply to Re: Compare two signed integers without using comparision operator in perl
by Util
in thread Compare two signed integers without using comparision operator in perl
by Das
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |