min (Function)

Signature: min(a: t0, b: t0) -> t0

Description: The smaller of two values of one numeric type, at that type. Integers compare in their own order, unsigned for the uint types. Floats follow IEEE 754 minimum: NaN on either side gives NaN and -0.0 is below 0.0. Total: performs no Arith operation.

Parameters

  • a (t0): The first value
  • b (t0): The second value, of the same numeric type

Returns: t0

Example

let low = min(3, 7)  // 3
fn clamp(x, lo, hi) = max(lo, min(x, hi))
low = min (3, 7)  // 3
clamp (x, lo, hi) = max (lo, min (x, hi))