If I type:
int main() { return 0 % 0; }
I get back an error:
error C2124: divide or mod by zero
What is the reason behind this? Isn't the answer zero?
All numbers = to, say m < n mod(n), have the same remainder m when divided by n. Since mod(0) would thus require division by 0, which is undefined, mod(0) would also be undefined.
If you mean "the remainder after dividing", you can't divide by zero, so it's not defined.
3 things you should know about MOD in Excel If the divisor is 0, MOD returns the #DIV/0! error because you cannot divide by zero. If the number or divisor is a text value, an Excel Mod formula returns the #VALUE! error.
The modulus of 0 is 0. So, the modulus of a positive number is simply the number. The modulus of a negative number is found by ignoring the minus sign. The modulus of a number is denoted by writing vertical lines around the number.
In mathematics, x mod 0
is undefined, hence the error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With