∧
Translation status: 简体中文 reader-locale proof. Code fences render through the zh-Hans pipeline; prose is canonical Latin.
Bitwise and, or, xor, not, and shifts on numerus operands.
Syntax: <expression> ∧ <expression> | <expression> ⊻ <expression> | ¬ <expression> | <expression> ⇐ <expression> | <expression> ⇒ <expression>
Category#
bitwise
Related#
- ∨
- ⊻
- ¬
- ⇐
- ⇒
Examples#
radix/corpus/operatores/bitwise.fab (canonical · operator-group)#
Bitwise and, or, xor, not, and shifts on numerus operands.
# =============================================================================
# ∧ — Bitwise and, or, xor, not, and shifts on numerus operands.
# =============================================================================
#
# What this teaches:
# • Bitwise operators — `∧` (and), `∨` (or), `⊻` (xor), `¬` (not), `⇐` (shift left), `⇒` (shift right).
# • Integer bit patterns — Visual demonstration of bitwise operations with binary literals.
#
# Common mistakes:
# • Confusing ∧ (bitwise and) with et (logical and) — they operate at different levels.
#
# See also: ∨, ⊻, ¬, ⇐, ⇒
# =============================================================================
# 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).
main {
const _ vexilla ← 0b1010
const _ persona ← 0b1100
const _ coniuncta ← vexilla ∧ persona
# 8 (0b1000)
print coniuncta
const _ diversa ← vexilla ⊻ persona
# 6 (0b0110)
print diversa
const _ sinistra ← 1 ⇐ 4
# 16
print sinistra
const _ dextra ← 16 ⇒ 2
# 4
print dextra
}Expected output:
8
6
16
4