SplitScript reference / Numeric / min

Numeric.min

Method

T.min(other: T) -> T where T: Numeric

Returns the smaller of two numeric values.

Both values have the same inferred numeric type and are evaluated once. For floating-point values, either NaN input produces NaN. If the values are positive and negative zero, negative zero is returned.

Parameters

  • other: The other value to compare with the receiver.

Effects: pure

Runtime behavior: available everywhere; synchronous

Examples

Keep the smaller value

let visibleStage = 9u32.min(7)