in reply to comparison with bitwise operators
if( 3-2 == abs( 3+2 - 2*$var ) ) { # q-: }
If you have 3 values, it takes slightly more work:
if( not $var**3 - 12*$var**2 + 41*$var - 42 ) { # $var is 2, 3, or 7 }
For the specific case of 2 and 3:
if( 3 == ( $var | 1 ) ) {
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: comparison with bitwise operators (horror)
by ikegami (Patriarch) on Jan 13, 2011 at 22:04 UTC |