Re: Re: #22527 [Opn->Bgs]: Modulus returned negative value
| From: | Sascha Schumann | Date: | Tue, 04 Mar 2003 15:56:11 +0000 |
| Subject: | Re: Re: #22527 [Opn->Bgs]: Modulus returned negative value | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-94762@lists.php.net to get a copy of this message | ||
> Yeah, I read that in the bug report and confirmed that as the intended
> behavior in C. What I meant was 'regardless of what the ISO standard
> says, thats not a standard mathematical definition.'
Well, the standard mathematical definition
r = a mod b <=> a = floor(a/b) * b + r
for 0 <= r < b applies only, if a, b are members of N
("natürliche Zahlen", > 0). You cannot simply extend it to
Z.
As such, it does not apply to the example -27 mod 7, because
-27 is evidently not part of N.
- Sascha