Modulo Bug?

David Nadlinger see at klickverbot.at
Sat Aug 11 07:01:06 PDT 2012


On Saturday, 11 August 2012 at 13:48:16 UTC, David wrote:
> -1 % 16 = -1
>
> Shouldn't that be 15? It seems like the sign is ignored for the 
> modulo.
>
> Is this a bug or intended behaviour? The Python implementation 
> returns here, as expected, 15.

http://en.wikipedia.org/wiki/Modulo_operation

David


More information about the Digitalmars-d mailing list