Renderingla

Numeric value equality after promotion join — not fuzzy float.

Syntax: <expression> ≈ <expression> | <expression> ≉ <expression>

Category

comparison

Related

Examples

examples/corpus/operatores/numeric-value-eq.fab (canonical · operator)

Numeric value equality after promotion join — not fuzzy float.

# operatores/numeric-value-eq — ≈ ≉
#
# WHY: ≡ requires identical types; ≈ promotes numerics then exact-compares.
# 42.145 ≈ 42 must stay false (no hidden tolerance).

incipit {
    fixum numerus<u8> port ← 42 ∷ numerus<u8>
    fixum numerus count ← 42
    fixum _ same_width ← port ≈ count
    nota same_width

    fixum _ int_float ← 1 ≈ 1.0
    nota int_float

    fixum _ not_fuzzy ← 42.145 ∷ fractus<f64> ≈ 42.0 ∷ fractus<f64>
    nota not_fuzzy

    fixum _ differs ← 1 ≉ 2
    nota differs
}

Expected output:

verum
verum
falsum
verum