AngouriMath

Navigation

← Back to list of members

op_Modulus​(AngouriMath.​Entity.​Number.​Rational,​AngouriMath.​Entity.​Number.​Rational)

 Method (no overloads)

Summary

The floored remainder, which takes the sign of the divisor: -7/2 % 3 is 5/2
and -7/2 % (-3) is -1/2.
See https://github.com/asc-community/AngouriMath/issues/708.

Remarks

Adding the divisor whenever the truncated remainder came out negative is the
right conversion only where the divisor is positive; for a negative one it
moved the answer further from zero, so (-7/2) % (-3) came back as -7/2 --
larger in magnitude than the divisor, and a remainder under no convention.

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 1953 pages online