Operators
The scalar operators work on arrays, element by element, with NumPy’s broadcasting rules.SFShapeError before anything is computed.
Events are counted
An event in any element is one event for the operation, reported with a count, and handled by the policy in catalogue order:Masked division
sf.div(a, b, where=mask) divides only where the mask is true. Other elements are 0 and raise nothing, which is the usual way to handle a divisor that may be zero:
where only guards the zeros. An element where |a| >= |b| still overflows and is still reported.
Functions
sf.fma, sf.sqrt, sf.maximum, sf.minimum, sf.clip, sf.where and sf.cast all accept arrays and broadcast.