--- from: http://rosettacode.org/wiki/Ternary_logic note: Logic