~ is bitwise NOT in code, logical NOT in some textbooks
~ is the bitwise complement in C, Java, JavaScript and Python, where ~1 is -2, and the logical NOT in some logic textbooks. The parser rejects ~A and offers NOT, ! or ¬.
The diagnostic recorded below reads: ~ is not a supported operator; use NOT, ! or ¬ for negation. In the C family the tilde flips every bit of an integer, so ~1 is -2 and ~0 is -1, both of which count as true; a programmer who writes if (~flag) has written a condition that is always true. In Python ~True is -2 as well, because bool is a subclass of int.
In logic texts the tilde is an honest negation sign, which is exactly why it is dangerous here: a formula copied from a textbook and a condition copied from a program use the same character for different operations. The engine's spellings of negation are the word NOT, the programming !, the mathematical ¬ and the algebra prime A', and all four print back to each other.
The same reasoning rejects ^ and the single & and |: each has a bitwise meaning in code that would silently change the function of a rule. The symbols page lists every accepted and rejected spelling with the parser's own message.
What the parser says
| You typed | Code | Why it is rejected | Repair offered |
|---|---|---|---|
| ~A | unsupported-operator | `~` is not a supported operator. Use `NOT`, `!`, or `¬` for negation. | Replace with NOT |
The common slip
Translating ~A from a textbook as NOT A by hand and ~flag from C the same way. The first is right; the second is a bitwise complement that is true for every value except -1, and the engine rejects both spellings so that you check which one you have.
Questions
Why is ! accepted but ~ not?
! is logical NOT in every language of the C family, with the same meaning as the engine's NOT. ~ is bitwise there and logical in textbooks, so a single reading would be wrong for one of its sources.
Is ¬ accepted?
Yes, as the mathematical spelling, along with the overline-free prime A' of the algebra notation.
Related
Tools
- Logical equivalence checker: two expressions, exact verdict, counterexample
- Truth table generator: any Boolean expression, up to 12 variables, with intermediate columns
See also
- NOT gate (inverter): truth table, symbol and the NOT operator
- Logic symbols: meanings, LaTeX, Unicode and how to type them
- Boolean logic in C: logical vs bitwise operators
- Boolean logic in Python: and, or, not, precedence and common mistakes
- Single & and | are bitwise in most languages
- ^ means XOR in C, Java and Python, not AND or power
Pitfalls
Generated from the Tangibool engine, semantics tangibool-semantics/1, engine 1.0.0, build . Every table, map, simplification and verdict on these pages was computed by the Tangibool engine when the site was built, and every claim was re-checked by the same exact checker the app uses. Limits are stated where they apply. © 2026 Foreranger LTD.