LargeInteger.st
changeset 5008 1a19e0059c54
parent 5002 e895e251d501
child 5014 fa22b711e749
--- a/LargeInteger.st	Thu Nov 18 21:35:14 1999 +0100
+++ b/LargeInteger.st	Fri Nov 19 09:11:44 1999 +0100
@@ -3391,9 +3391,12 @@
 #else
                     unsigned INT _sum = __unsignedLongIntVal(self) + __unsignedLongIntVal(aLargeInteger);
 #endif /* not LSB_FIRST */
-                    _uint = __MKUINT(_sum);
-                    if (!__isSmallInteger(_uint))
+                    if (_sum <= _MAX_INT) {
+                        _uint = __MKSMALLINT(_sum * __intVal(newSign));
+                    } else {
+                        _uint = __MKULARGEINT(_sum);
                         __LargeIntegerInstPtr(_uint)->l_sign = newSign;
+                    }
                     RETURN (_uint);
                 }
             }
@@ -4285,5 +4288,5 @@
 !LargeInteger class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/LargeInteger.st,v 1.148 1999-11-18 16:10:32 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/LargeInteger.st,v 1.149 1999-11-19 08:11:44 stefan Exp $'
 ! !