--- a/Fraction.st Wed Oct 28 17:18:22 1998 +0100
+++ b/Fraction.st Wed Oct 28 17:18:45 1998 +0100
@@ -622,6 +622,42 @@
!Fraction methodsFor:'truncation and rounding'!
+fractionPart
+ "extract the after-decimal fraction part."
+
+ numerator < denominator ifTrue:[
+ ^ self
+ ].
+ ^ super fractionPart
+
+ "
+ (3/2) fractionPart
+ (2/3) fractionPart
+ ((3/2)*(15/4)) fractionPart
+ ((2/3)*(4/15)) fractionPart
+ "
+
+ "Modified: / 28.10.1998 / 17:15:11 / cg"
+!
+
+integerPart
+ "extract the pre-decimal integer part."
+
+ numerator < denominator ifTrue:[
+ ^ 0
+ ].
+ ^ super integerPart
+
+ "
+ (3/2) integerPart
+ (2/3) integerPart
+ ((3/2)*(15/4)) integerPart
+ ((2/3)*(4/15)) integerPart
+ "
+
+ "Modified: / 28.10.1998 / 17:16:10 / cg"
+!
+
rounded
"return the receiver rounded to the nearest integer as integer"
@@ -666,6 +702,6 @@
!Fraction class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Fraction.st,v 1.42 1998-07-09 08:06:37 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Fraction.st,v 1.43 1998-10-28 16:18:45 cg Exp $'
! !
Fraction initialize!