[clean-list] mod and rem operators

RT Happe rthappe@mathematik.uni-freiburg.de
Sun, 17 Feb 2002 18:05:33 +0100 (CET)


> the operators "mod" and "rem" seems to be doing exactly the same thing
> (incorrectly).
>
> Example:
>   -1 rem 7   ->   -1  (ok)
>   -1 mod 7   ->   -1  (shouldn't this be 6?)

mod and rem don't implement the mathematical modulo and remainder (as the
comment in StdInt.dcl makes us believe) but rather the ersatz operations
the underlying C library resp. hardware deign to present.  Cf.
http://www.cs.kun.nl/pipermail/clean-list/1998/000512.html

rthappe