Error of the MOD function

MOD of y divided by x is defined as y - x INT(y/x) There is a case when the MOD function returns an erroneous result and that is when y is numerically equal to x but one is a positive number and the other is a negative number. This happens whether x and y are integers or decimal numbers.


For example, when y = 4, x= -4, MOD(4,-4) returns -4, when the correct answer is 0 using the definition formula, and

when y = -4, x =4, MOD(-4,4) returns 4, when the correct answer is again 0 using the definition formula.

MacBook Pro, macOS High Sierra (10.13.5)

Posted on Jun 12, 2018 8:58 PM

Reply
16 replies

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Error of the MOD function

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.