(rontolisp) docs
← Functions

linalg:maximum

(linalg:maximum a b)

Returns a fresh array with the element-wise larger of a and b (numpy's np.maximum); the operands broadcast by numpy's rules, exactly as linalg:add describes (a scalar over the other operand's shape, arrays of different shapes along their trailing axes). It is defined by the strict comparison (if (> x y) x y), not by an IEEE min/max primitive: the second operand wins whenever the comparison is false, which covers ties (a -0.0 element against 0.0 takes the second operand) and unordered NaN comparisons ((linalg:maximum nan-array b) takes b's elements, the reverse keeps the NaNs). The same rule on every backend. As a named function it is accelerated under --simd.