⤒
Translation status: Tiếng Việt reader-locale proof. Term names and code fences follow the vi 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
Related#
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 ← 2 ⤒ 5
print scalar
const list<int> values ← [1, 5, 9]
const list<int> clamped ← values ⤒ 4 ⤓ 8
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.0 ⤓ 1.0
print clamped_tensor.sum()
}Expected output:
5
17
1.5