Version 9 of !

Updated 2009-02-11 17:48:19 by LV

expr boolean negation operator

returns truth (1) if the argument is a falsehood, and falsity (0) of the argument is true

For bitwise "not" use the ~ operator.


AMG: To convert a value to its canonical boolean representation (i.e. 0 or 1), you can use [expr {!!$val}].

LV Out of curiosity, why are two ! needed? Doesn't one ! always result in either a 0 or a 1 being returned?

AMG: Yes, but using a single ! will also invert the value. Using an even number of !'s will cause the value to not be inverted.

LV I apologize. I should have thought of that myself :blush: ...