#DOCUMENTATION
authorStefan Vogel <sv@exept.de>
Thu, 10 Mar 2016 15:05:49 +0100
changeset 19315 e11b9d45bb9c
parent 19314 698cf296ef6d
child 19316 a6049bf9fcc0
#DOCUMENTATION class: Integer comment/format in: #digitByteLength
Integer.st
--- a/Integer.st	Thu Mar 10 13:39:19 2016 +0100
+++ b/Integer.st	Thu Mar 10 15:05:49 2016 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1988 by Claus Gittinger
               All Rights Reserved
@@ -756,6 +754,8 @@
     "Modified: / 15.11.1999 / 20:35:20 / cg"
 ! !
 
+
+
 !Integer class methodsFor:'class initialization'!
 
 initialize
@@ -801,6 +801,7 @@
     "Modified: 18.7.1996 / 12:26:38 / cg"
 ! !
 
+
 !Integer class methodsFor:'prime numbers'!
 
 flushPrimeCache
@@ -1176,6 +1177,7 @@
     ^ self == Integer
 ! !
 
+
 !Integer methodsFor:'*Roe'!
 
 acceptRoeVisitor: aVisitor
@@ -2382,8 +2384,9 @@
 !
 
 digitByteLength
-    "return the number bytes required for a 2's complement
-     binary representation of this Integer.
+    "return the number bytes required for the binary representation of this Integer.
+     For negative integers the number of bytes required for the 2's complement representation
+     is returned.
      For positive receivers, that's the same as the digitLength."
 
     |absLen "{ Class: SmallInteger }" |
@@ -2398,6 +2401,8 @@
 
     "
      -129 digitByteLength
+     -32769 digitByteLength
+     32768 digitByteLength
     "
 
     "Created: / 25.10.1998 / 14:58:09 / cg"
@@ -3443,7 +3448,7 @@
     ^ fibUsingDict value:self
 
     "the running time is mostly dictated by the LargeInteger multiplication performance...
-     (therefore, we get O(n²) execution times, even for a linear number of multiplications)
+     (therefore, we get O(n²) execution times, even for a linear number of multiplications)
 
      Time millisecondsToRun:[50000 fib_iterative]  312    (DUO 1.7Ghz CPU)
      Time millisecondsToRun:[50000 fib_helper]     109
@@ -4820,6 +4825,7 @@
     "Created: / 09-01-2012 / 17:18:06 / cg"
 ! !
 
+
 !Integer methodsFor:'special modulo arithmetic'!
 
 add_32:anInteger