Re: [PHP-DEV] Re: #22527 [Opn->Bgs]: Modulus returned negative value

[email protected] (Sascha Schumann)
Newsgroups php.dev
Message-ID <[email protected]>
> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.