...is easier to maintain because it is more explicit as to what is required for a truth value. Anyone versed in boolean algebra will easily recognize the sum-of-product form here and instantly grasp the intent.if( !$x && !$y && $z or !$x && $y && !$z or $x && !$y && !$z ) { print "Exactly one..."; }
In reply to Re^3: One out of three ain't bad
by Anonymous Monk
in thread One out of three ain't bad
by saintmike
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |