Bitwise and, or, xor, not, and shifts on numerus operands.
Syntax: <expression> ∧ <expression> | <expression> ⊻ <expression> | ¬ <expression> | <expression> ⇐ <expression> | <expression> ⇒ <expression>
Category
bitwise
Related
Examples
examples/corpus/operatores/bitwise.fab (canonical · operator-group)
Bitwise and, or, xor, not, and shifts on numerus operands.
# operatores/bitwise — ∧ ⊻ ¬ ⇐ ⇒
#
# GRAMMAR:
# bitwiseExpr :← expr ('∧' | '⊻' | '⇐' | '⇒') expr | '¬' expr
#
# EXPECTED OUTPUT:
# 8, 6, 16, 4
#
# BACKEND:
# Integer bit patterns; cross-ref binarius/binarius.fab for combined tour.
# Unary ¬ documented in syntax; Rust emits `~` (whitelist if reintroduced in body).
incipit {
fixum _ vexilla ← 0b1010
fixum _ persona ← 0b1100
fixum _ coniuncta ← vexilla ∧ persona
# 8 (0b1000)
nota coniuncta
fixum _ diversa ← vexilla ⊻ persona
# 6 (0b0110)
nota diversa
fixum _ sinistra ← 1 ⇐ 4
# 16
nota sinistra
fixum _ dextra ← 16 ⇒ 2
# 4
nota dextra
}Expected output:
8
6
16
4