Re: [Bug] math.mod behaves differently than the modulus operator.
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: [Bug] math.mod behaves differently than the modulus operator.
- From: Daniel Stephens <daniel@...>
- Date: 2008年1月26日 14:02:02 -0800
The manual doesn't claim that % and math.mod are the same, it simply says:
a % b == a - math.floor(a/b)*b
And in this case that IS consistent with your observed results.
Polarina wrote:
math.mod behaves differently than the modulus operator.
How to reproduce:
= math.mod(7, -(1 / 0))
7
= 7 % -(1 / 0)
nan