⤒
Translation status: English reader-locale proof. Term names and code fences follow the en 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#
reduction
Related#
Examples#
radix/corpus/reference/operator-group/maximum/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 {
let int scalar ← 2.maximum(5)
print scalar
let list<int> values ← [1, 5, 9]
let list<int> clamped ← values.maximum(4).minimum(8)
print clamped.sum()
let list<f32> flat ← [-1.0, 0.5, 2.0]
let tf32[3] values_tensor ← flat ↦ tensor<f32, [3]>
let tf32[3] clamped_tensor ← values_tensor.maximum(0.0).minimum(1.0)
print clamped_tensor.sum()
}Expected output:
5
17
1.5