SIMD module

min

procedure · 2 overloadsSource

The lane-wise smaller of two vectors. Each lane is Basic.min of the two values, so with a NaN lane the answer depends on the operand order, as it does in scalar code.

ExampleOpen in playground ↗
a := set(4, cast(s32) 3);
b := set(4, cast(s32) 5);
assert(min(a, b).data[0] == 3);
assert(min(a, cast(s32) 4).data[0] == 3);
min :: (a: $T/SIMD_Array, b: T) -> T

The lane-wise smaller of two vectors. Each lane is Basic.min of the two values, so with a NaN lane the answer depends on the operand order, as it does in scalar code.

Parameters

b: T

Returns

T
ExampleOpen in playground ↗
a := set(4, cast(s32) 3);
b := set(4, cast(s32) 5);
assert(min(a, b).data[0] == 3);
assert(min(a, cast(s32) 4).data[0] == 3);
min :: (a: $T/SIMD_Array, factor: a.type) -> T

The lane-wise smaller of each lane and factor. Each lane is Basic.min of the two values, so with a NaN lane the answer depends on the operand order, as it does in scalar code.

Parameters

factor: a.type

Returns

T

See also