[an error occurred while processing this directive]
Demorgan's Law
Sometimes it can be confusing to think about boolean expressions with
not's and or's.
For example
If the value is not 2 or not 3 then ...
becomes the always true:
if ((v != 2) || (v != 3)) ...
when we really want:
if ((v != 2) && (v != 3)) ...
You can always use some tautologies to simplify things.
Demorgan's law
- not(P and Q) = (not P) or (not Q)
- not(P or Q) = (not P) and (not Q)
from the meaning of not
[an error occurred while processing this directive]
Sunday, 16-Feb-1997 11:57:15 EST