SIMD module

max

procedure2 overloadsSource

The lane-wise larger of two vectors. With a NaN lane the answer depends on the operand order, as in scalar code.

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

Parameters

b: T

Returns

T
max :: (a: $T/SIMD_Array, factor: a.type) -> T

The lane-wise larger of each lane and factor. With a NaN lane the answer depends on the operand order, as in scalar code.

Parameters

factor: a.type

Returns

T
Example↗
a := set(4, cast(s32) 3);
assert(max(a, cast(s32) 4).data[1] == 4);

See also