p: modulo p operation. p must be flint less than maxflint.
Return value
The value of the sum of the arguments is returned.
Take care that for floating entries, the addition is not perfectly associative due to rounding errors. This call performs additions in reverse incoming order. If you have not changed the processor rounding mode, round toward nearest mode tie to even is generally performed on standard systems.
equivalent to the call on the elements of the tuple.
The call add[saturated](...) computes a saturated version of add. Take care that for signed integral entries this kind of addition is not associative at all. This call perform saturated additions in reverse incoming order.
The summation is computed in a round toward \(-\infty\) mode. The result is guaranteed to be less or equal to the exact one (except for Nans). Combined with strict the option ensures generally faster computation, but strict inequality.
The summation is computed in a round toward \(\infty\) mode. The result is guaranteed to be greater or equal to the exact one (except for Nans). Combined with strict the option ensures generally faster computation, but strict inequality.
The summation is computed in the double sized element type (if available). This decorator has no effect on double and 64 bits integrals.
The summation is computed in a round toward nearest mode but tie to odd (not hardware available on common systems).
compute the result in modular arithmetic. the parameters must be floating positive and less than the modulus. The modulus itself must be less than maxflint.
A kahan like summation is performed ensuring better accuracy, using two-add function. If the x, ...xs parameter are assumed positive and non increasing (or at least with non increasing exponents) adding raw option can speed a bit the accurate summation,
Note
Although the infix notation with + is supported for two parameters, the + operator on standard scalar types is the original one and so can lead to automatic promotion.
add has many options. The regular user will only be interested with saturated, unless it has to deal with uncommon accuracy or order properties requirements whose enforcement can have an heavy cost even if hardware fma-like processor intrinsics are available.