--- a/SmallInteger.st Tue Oct 02 15:56:51 2001 +0200
+++ b/SmallInteger.st Tue Oct 02 16:35:22 2001 +0200
@@ -545,6 +545,8 @@
and negative, if the operands signs differ.
Be careful with negative results: 9 // 4 = 2,
while -9 // 4 = -3.
+ The following is always true:
+ (receiver // aNumber) * aNumber + (receiver \\ aNUmber) = receiver
See #quo: which returns -2 in the latter."
%{ /* NOCONTEXT */
@@ -640,6 +642,8 @@
"Answer the integer remainder m defined by division with truncation toward
negative infinity. The remainder has the same sign as aNumber.
m < |aNumber| AND there is an integer k with (k * aNumber + m) = self
+ The following is always true:
+ (receiver // aNumber) * aNumber + (receiver \\ aNumber) = receiver
Compare with #rem:
Redefined for speed."
@@ -742,6 +746,8 @@
"return the integer part of the quotient of the receivers value
and the arguments value. The result is truncated towards zero
and negative, if the operands signs differ..
+ The following is always true:
+ (receiver quo: aNumber) * aNumber + (receiver rem: aNumber) = receiver
For positive results, this is the same as #//,
for negative results, the remainder is ignored.
I.e.: '9 // 4 = 2' and '-9 // 4 = -3'
@@ -3332,5 +3338,5 @@
!SmallInteger class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.137 2001-10-02 09:58:50 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.138 2001-10-02 14:35:20 cg Exp $'
! !