Integer.st
changeset 18905 256565ff9803
parent 18865 1e6e937f7cf0
child 18907 77e711d30041
child 18981 7a7c47446e9c
--- a/Integer.st	Tue Nov 17 21:07:57 2015 +0100
+++ b/Integer.st	Tue Nov 17 21:08:12 2015 +0100
@@ -753,6 +753,8 @@
     "Modified: / 15.11.1999 / 20:35:20 / cg"
 ! !
 
+
+
 !Integer class methodsFor:'class initialization'!
 
 initialize
@@ -798,6 +800,7 @@
     "Modified: 18.7.1996 / 12:26:38 / cg"
 ! !
 
+
 !Integer class methodsFor:'prime numbers'!
 
 flushPrimeCache
@@ -1124,6 +1127,7 @@
     ^ self == Integer
 ! !
 
+
 !Integer methodsFor:'*Roe'!
 
 acceptRoeVisitor: aVisitor
@@ -1392,6 +1396,7 @@
     "
 ! !
 
+
 !Integer methodsFor:'bcd conversion'!
 
 decodeFromBCD
@@ -4250,9 +4255,7 @@
 nextPowerOf2
     "return the power of 2 at or above the receiver.
      Useful for padding.
-     Notice: if you often need nextPowerOf2 of a largeInteger,
-     you may wonna redefine it there using a much faster fill-with-1-bits algorithm
-     (i.e. determine highbit, fill with ones, add one)."
+     Notice, that for a powerOf2, the receiver is returned."
 
     |x t sh|
 
@@ -4284,7 +4287,14 @@
      22 nextPowerOf2
      12 factorial nextPowerOf2  isPowerOf:2  
      100 factorial nextPowerOf2  isPowerOf:2  
-     1000 factorial nextPowerOf2  isPowerOf:2  
+     1000 factorial nextPowerOf2  isPowerOf:2
+     Time millisecondsToRun:[
+         |v|
+         v := 1000 factorial.
+         1000 timesRepeat:[
+            v nextPowerOf2    
+         ]    
+     ]    
     "
 !
 
@@ -4353,6 +4363,7 @@
     "Created: / 09-01-2012 / 17:18:06 / cg"
 ! !
 
+
 !Integer methodsFor:'special modulo arithmetic'!
 
 add_32:anInteger