≡
Translation status: English reader-locale proof. Term names and code fences follow the en pack; supporting prose may still be English.
Equality and ordering comparisons returning bool.
Syntax: <expression> ≡ <expression> | <expression> ≢ <expression> | <expression> ≤ <expression> | <expression> ≥ <expression>
Category#
comparison
Related#
Examples#
radix/corpus/reference/operator-group/eq-eq/comparatio.fab (canonical · operator-group)#
Equality and ordering comparisons returning bool.
test "equal and not-equal comparisons" {
assert 10 ≡ 10
assert 10 ≢ 5
}
test "ordering and chained interval" {
assert 5 ≤ 10
assert 10 ≥ 5
assert 0 ≺ 5 and 5 ≺ 10
}
# =============================================================================
# ≡ — Equality and ordering comparisons returning bool.
# =============================================================================
#
# What this teaches:
# • Comparison operators — `≡` (equal), `≢` (not equal), `≤` (less-or-equal), `≥` (greater-or-equal).
# • Chaining — Comparisons can be chained with `et` for interval tests like `0 < x et x < 10`.
#
# Common mistakes:
# • Using == instead of ≡ for equality, or != instead of ≢ for inequality — Faber uses Unicode operators.
#
# See also: ≢, ≤, ≥, est, assert
# =============================================================================
# operatores/comparatio — ≡ ≢ ≤ ≥
#
# GRAMMAR:
# cmpExpr :← expr ('≡' | '≢' | '≤' | '≥' | '<' | '>') expr
#
# EXPECTED OUTPUT:
# true, true, true, true, true
#
# BACKEND:
# Scalar bool stdout; chain with et for interval tests.
main {
let bool aequalis ← 10 ≡ 10
print aequalis
let bool diversus ← 10 ≢ 5
print diversus
let bool nonMaior ← 5 ≤ 10
print nonMaior
let bool nonMinor ← 10 ≥ 5
print nonMinor
let bool in_range ← 0 ≺ 5 and 5 ≺ 10
print in_range
}Expected output:
true
true
true
true
true