The else condition means that one of the numbers is zero, and sifgn doesn't mean anything then.my $samesign, $first, $second; if (($first * $second) > 0) { $samesign = 'true'; } elsif (($first * $second) < 0) { { $samesign = 'false'; } else { $samesign = undef; }
In reply to Re: Seeing if two numbers have the same sign
by girarde
in thread Seeing if two numbers have the same sign
by grinder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |