From jan@swi.psy.uva.nl  Mon Jul 19 11:46:50 1999
Received: from gollem.swi.psy.uva.nl (jan@gollem.swi.psy.uva.nl [145.18.114.15])
	by swi.swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id LAA17151
	for <prolog@swi.psy.uva.nl>; Mon, 19 Jul 1999 11:46:50 +0200 (MET DST)
Received: from localhost (localhost [[UNIX: localhost]])
	by gollem.swi.psy.uva.nl (8.8.8/8.8.8) id LAA15145;
	Mon, 19 Jul 1999 11:48:40 +0200
From: Jan Wielemaker <jan@swi.psy.uva.nl>
To: prolog@swi.psy.uva.nl, Koos Dering <jdering@asz-home.nl>
Subject: Re: rem/mod ops
Date: Mon, 19 Jul 1999 11:46:24 +0200
X-Mailer: KMail [version 0.7.9]
Content-Type: text/plain
References: <3.0.5.32.19990718141500.00797570@pop.xs4all.nl>
MIME-Version: 1.0
Message-Id: <99071911484006.14803@gollem>
Content-Transfer-Encoding: 8bit

On Sun, 18 Jul 1999, Koos Dering wrote:
>According to the supplied help-information both the rem- and the
>mod-operator produce the 'remainder of division' however while mod
>(apparently) satisfies:
>(A // B ) * B + A mod B =:= A
>so implements what is usually called the remainder of (integer) division
>rem apparenty satisfies
>(A // B + A rem B ) * B =:= A
>or (equivalently)
>A rem B =:= float_fractional_part(A/B)
>
>While this might possibly be a useful function one would expect different
>descriptions for different functions.

As far as I can tell, the implementation conforms to what one should
expect, so I adjusted the documentation:

------------------------------------------------------------------------------
+IntExpr1 mod +IntExpr2
    Modulo:  Result = IntExpr1 - (IntExpr1 // IntExpr2)  * IntExpr1

+IntExpr1 rem +IntExpr2
    Remainder of division:  Result = float_fractional_part(IntExpr1/IntExpr2)

+IntExpr1 // +IntExpr2
    Integer division:  Result = truncate(Expr1/Expr2)
------------------------------------------------------------------------------

If someone thinks this is still wrong, please let me know.

	--- Jan

