Capy-Bearer Documentation

min

lib call

Capy

function min(a : f32, b : f32) f32
function min(a : f64, b : f64) f64
function min(a : s8, b : s8) s8
function min(a : s16, b : s16) s16
function min(a : s32, b : s32) s32
function min(a : s64, b : s64) s64
function min(a : u8, b : u8) u8
function min(a : u16, b : u16) u16
function min(a : u32, b : u32) u32
function min(a : u64, b : u64) u64

Description

Both arguments must have the same static type; min(1, 2.0) does not compile. Convert one side first. For floating-point input a NaN argument yields NaN.

Parameters

a : the first number

b : the second number, in the same type

Return Values

The smaller of the two, in their type.

Example

Capy

print(min(3, 9), " ", min(-1.5, 2.0), " ", min(u8(200), u8(100)), "\n")

Output

3 -1.5 100