Documentation moved.
This entry is documented with its primary interface. Open the documentation →
Function
src/index.ts:977nerdamer.mod
nerdamer.mod(x: Expression, y: Expression): ExpressionComputes the modulo (remainder) of x divided by y.
Exact Gaussian integers use the same quotient rule as Wolfram Language:
divide, round the real and imaginary quotient components independently to
the nearest integers with midpoint ties going to even, then subtract
y * quotient from x.
Complex values outside the Gaussian integers remain symbolic.
see
- https://reference.wolfram.com/language/ref/Mod.html - https://reference.wolfram.com/language/ref/Quotient.html - https://reference.wolfram.com/language/ref/Round.html
throws
core!UndefinedError If either x or y is ±∞.
Parameters
| Name | Type | Description |
|---|---|---|
x | Expression | The dividend. |
y | Expression | The divisor. |
Returns
Expression — The remainder of x / y.
Examples
mod(Expression.create(10), Expression.create(3)).text() // "1"
mod(Expression.create('5+3*i'), Expression.create('2+i')).text() // "-1"