العرضar

Translation status: العربية reader-locale proof. Term names and code fences follow the ar pack; supporting prose may still be English.

Maximum/minimum infix arrows on scalars, lists, and tensors, including chained clamp syntax.

Syntax: <expression> ⤒ <expression> | <expression> ⤓ <expression>

Category#

arithmetic

Examples#

radix/corpus/summa/minmax-infix.fab (canonical · operator-group)#

Maximum/minimum infix arrows on scalars, lists, and tensors, including chained clamp syntax.

# =============================================================================
# ⤒ / ⤓ — maximum, minimum, and chained clamp.
# =============================================================================
#
# What this teaches:
#   • Scalar extrema select between two numeric values.
#   • List extrema apply elementwise; the chained form clamps each element.
#   • Tensor extrema apply the same elementwise surface to shaped values.
#
# Glyph law: see docs/design/tensor-intrinsics.md (D4 amendment).
#
# EXPECTED OUTPUT:
#   5
#   17
#   1.5

main {
    const int scalar  25
    print scalar

    const list<int> values  [1, 5, 9]
    const list<int> clamped  values ⤒ 48
    print clamped.sum()

    const list<f32> flat  [-1.0, 0.5, 2.0]
    const tf32[] seed  empty
    const tf32[3] values_tensor  seed.from_flat(flat, [3])
    const tf32[3] clamped_tensor  values_tensor ⤒ 0.01.0
    print clamped_tensor.sum()
}

Expected output:

5
17
1.5