(rontolisp) docs
← Functions

linalg:add

(linalg:add a b)

Adds a and b elementwise, returning a fresh array. The operands broadcast by numpy's rules: a scalar is broadcast over the other operand's shape, and two arrays of different shapes align their trailing axes -- each aligned pair of extents must be equal or contain a 1 (a missing leading axis counts as 1), and the axis of extent 1 stretches over the other operand's extent; anything else signals a shape-mismatch error. The result keeps the first array operand's element type. The other elementwise operators are linalg:sub, linalg:mul and linalg:div.