#FEATURE
class: Integer
comment/format in:6 methods
changed: #inspectorExtraAttributes
--- a/Integer.st Fri Feb 26 19:28:16 2016 +0100
+++ b/Integer.st Fri Feb 26 19:48:26 2016 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
COPYRIGHT (c) 1988 by Claus Gittinger
All Rights Reserved
@@ -751,8 +753,6 @@
"Modified: / 15.11.1999 / 20:35:20 / cg"
! !
-
-
!Integer class methodsFor:'class initialization'!
initialize
@@ -798,7 +798,6 @@
"Modified: 18.7.1996 / 12:26:38 / cg"
! !
-
!Integer class methodsFor:'prime numbers'!
flushPrimeCache
@@ -1174,7 +1173,6 @@
^ self == Integer
! !
-
!Integer methodsFor:'*Roe'!
acceptRoeVisitor: aVisitor
@@ -2572,7 +2570,7 @@
!
signExtended24BitValue
- "return a smallInteger from sign-extending the 24'th bit.
+ "return an integer from sign-extending the 24'th bit.
i.e. interprets the lowest 24 bits as a signed integer,
ignoring higher bits.
This may be useful for communication interfaces"
@@ -2587,10 +2585,11 @@
"Modified: / 07-05-1996 / 09:31:57 / cg"
"Created: / 05-03-2012 / 14:37:55 / cg"
+ "Modified (comment): / 26-02-2016 / 19:39:52 / cg"
!
signExtendedByteValue
- "return a smallInteger from sign-extending the 8'th bit.
+ "return an integer from sign-extending the 8'th bit.
i.e. interprets the lowest 8 bits as a signed integer,
ignoring higher bits.
This may be useful for communication interfaces"
@@ -2603,13 +2602,15 @@
16rFF signExtendedByteValue
"
- "Created: 7.5.1996 / 09:31:52 / cg"
+ "Created: / 07-05-1996 / 09:31:52 / cg"
+ "Modified (comment): / 26-02-2016 / 19:39:46 / cg"
!
signExtendedFromBit:bitNr
- "return a smallInteger from sign-extending the n'th bit.
+ "return an integer from sign-extending the n'th bit.
i.e. interprets the lowest n bits as a signed integer,
ignoring higher bits.
+ The bit numbering is 1-based (i.e. the lowest bit has bitNr 1)
This may be useful for communication interfaces"
|masked|
@@ -2621,16 +2622,19 @@
^ masked
"
- 16r800008 signExtendedFromBit:4
- 16r7FFF07 signExtendedFromBit:4
+ 16r800008 signExtendedFromBit:4
+ 16r7FFF07 signExtendedFromBit:4
+ 16r7FFF0F signExtendedFromBit:4
16rFFFFFF signExtendedFromBit:8
16rFFFF7F signExtendedFromBit:8
"
+
+ "Modified (comment): / 26-02-2016 / 19:42:18 / cg"
!
signExtendedLongLongValue
- "return a smallInteger from sign-extending the 64'th bit.
+ "return an integer from sign-extending the 64'th bit.
i.e. interprets the lowest 64 bits as a signed integer,
ignoring higher bits.
This may be useful for communication interfaces"
@@ -2645,10 +2649,12 @@
16r1237FFFFFFFFFFFFFFF signExtendedLongLongValue
16r123FFFFFFFFFFFFFFFF signExtendedLongLongValue
"
+
+ "Modified (comment): / 26-02-2016 / 19:38:55 / cg"
!
signExtendedLongValue
- "return a smallInteger from sign-extending the 32'th bit.
+ "return an integer from sign-extending the 32'th bit.
i.e. interprets the lowest 32 bits as a signed integer,
ignoring higher bits.
This may be useful for communication interfaces"
@@ -2663,10 +2669,12 @@
16r7FFFFFFF signExtendedLongValue
16rFFFFFFFF signExtendedLongValue
"
+
+ "Modified (comment): / 26-02-2016 / 19:39:09 / cg"
!
signExtendedShortValue
- "return a smallInteger from sign-extending the 16'th bit.
+ "return an integer from sign-extending the 16'th bit.
i.e. interprets the lowest 16 bits as a signed integer,
ignoring higher bits.
This may be useful for communication interfaces"
@@ -2683,7 +2691,8 @@
16r123FFFF signExtendedShortValue
"
- "Modified: 7.5.1996 / 09:31:57 / cg"
+ "Modified: / 07-05-1996 / 09:31:57 / cg"
+ "Modified (comment): / 26-02-2016 / 19:39:37 / cg"
! !
!Integer methodsFor:'comparing'!
@@ -3431,7 +3440,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
@@ -4808,7 +4817,6 @@
"Created: / 09-01-2012 / 17:18:06 / cg"
! !
-
!Integer methodsFor:'special modulo arithmetic'!
add_32:anInteger