Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is the difference between remainder and modulus?

difference modulus remainder
0
Posted

What is the difference between remainder and modulus?

0

Remainder and modulus differ in the cases in which the numerator’s and quotient’s signs differ. The remainder is based on rounding down (towards zero; truncate): [trunc(5,3)==1, rem(5,3)==2] 5==1*3+2, -5==-1*3+-2, 5==-1*-3+2, -5==1*-3+-2; the remainder gets the numerator’s sign. Modulus is based on rounding floor (towards negative): 5==1*3+2, -5==-2*3+1, 5==-2*-3+-1, -5==1*-3+-2; the remainder gets the quotient’s sign.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123