--- a/Integer.st Fri Jul 21 15:12:38 2017 +0200
+++ b/Integer.st Fri Jul 21 15:14:01 2017 +0200
@@ -2692,7 +2692,8 @@
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"
+ This may be useful for communication interfaces.
+ (kind of the reverse operation to asUnsigned:)."
^ self signExtendedFromMaskBit:(1 bitShift:bitNr-1)
@@ -2713,7 +2714,7 @@
16rFFFF80 signExtendedFromBit:8 -> -128
"
- "Modified: / 21-07-2017 / 14:53:40 / cg"
+ "Modified (comment): / 21-07-2017 / 15:13:55 / cg"
!
signExtendedFromMaskBit:highBitMask
@@ -5227,7 +5228,8 @@
asUnsigned:numBits
"return a numBits integer with my bit-pattern, but positive.
May be required for bit operations on the sign-bit and/or to
- convert C/Java numbers."
+ convert C/Java numbers, or to generate bitields from signed numbers
+ (kind of the reverse operation to signExtenedFromBit:)."
self < 0 ifTrue:[
^ (1 bitShift:numBits) + self