Fraction.st
changeset 369 730e0f5d2404
parent 359 b8df66983eff
child 379 5b5a130ccd09
--- a/Fraction.st	Thu Jul 27 06:12:43 1995 +0200
+++ b/Fraction.st	Fri Jul 28 04:38:43 1995 +0200
@@ -21,7 +21,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/Fraction.st,v 1.20 1995-06-27 02:12:59 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Fraction.st,v 1.21 1995-07-28 02:36:41 claus Exp $
 '!
 
 !Fraction class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/Fraction.st,v 1.20 1995-06-27 02:12:59 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Fraction.st,v 1.21 1995-07-28 02:36:41 claus Exp $
 "
 !
 
@@ -89,6 +89,7 @@
     "create and return a new fraction with numerator num and denominator den"
 
 %{  /* NOCONTEXT */
+
     /* this check allows subclassing .. */
     if (self == Fraction) {
 	if (_CanDoQuickAlignedNew(sizeof(struct __fraction))) {
@@ -99,9 +100,11 @@
 	    _InstPtr(newFraction)->o_class = Fraction;
 	    _FractionInstPtr(newFraction)->f_numerator = num;
 	    _FractionInstPtr(newFraction)->f_denominator = den;
-	    spc = __qSpace(newFraction);
-	    __STORE_SPC(newFraction, num, spc);
-	    __STORE_SPC(newFraction, den, spc);
+	    if (! __bothSmallInteger(num, den)) {
+	        spc = __qSpace(newFraction);
+	        __STORE_SPC(newFraction, num, spc);
+	        __STORE_SPC(newFraction, den, spc);
+	    }
 	    RETURN ( newFraction );
 	}
     }