#DOCUMENTATION by cg
authorClaus Gittinger <cg@exept.de>
Tue, 21 Nov 2017 13:15:02 +0100
changeset 22370 590a315a9d33
parent 22369 6510a4f3fbd9
child 22371 1af34d1ea5a5
#DOCUMENTATION by cg class: LargeInteger comment/format in: #setBit:
LargeInteger.st
--- a/LargeInteger.st	Tue Nov 21 13:13:25 2017 +0100
+++ b/LargeInteger.st	Tue Nov 21 13:15:02 2017 +0100
@@ -315,8 +315,6 @@
     "Modified: / 8.5.1998 / 21:40:41 / cg"
 ! !
 
-
-
 !LargeInteger class methodsFor:'coercing & converting'!
 
 coerce:aNumber
@@ -1289,35 +1287,37 @@
 setBit:index
     "return a new integer, where the specified bit is on.
      Bits are counted from 1 starting with the least significant.
-     The methods name may be misleading: the receiver is not changed,
+     The method's name may be misleading: the receiver is not changed,
      but a new number is returned. Should be named #withBitSet:"
 
     |myDigitLength newDigitLength newDigitBytes byteIndexOfBitToSet|
 
     index <= 0 ifTrue:[
-	^ SubscriptOutOfBoundsSignal
-		raiseRequestWith:index
-		errorString:'index out of bounds'
+        ^ SubscriptOutOfBoundsSignal
+                raiseRequestWith:index
+                errorString:'index out of bounds'
     ].
 
     myDigitLength := digitByteArray size.
     byteIndexOfBitToSet := ((index-1)//8)+1.
     byteIndexOfBitToSet > myDigitLength ifTrue:[
-	newDigitLength := myDigitLength max:byteIndexOfBitToSet.
-	newDigitBytes := ByteArray new:newDigitLength.
-	newDigitBytes replaceFrom:1 to:myDigitLength with:digitByteArray startingAt:1.
+        newDigitLength := myDigitLength max:byteIndexOfBitToSet.
+        newDigitBytes := ByteArray new:newDigitLength.
+        newDigitBytes replaceFrom:1 to:myDigitLength with:digitByteArray startingAt:1.
     ] ifFalse:[
-	newDigitBytes := digitByteArray copy
+        newDigitBytes := digitByteArray copy
     ].
     newDigitBytes
-	at:byteIndexOfBitToSet
-	put:((newDigitBytes at:byteIndexOfBitToSet) setBit:(((index-1)\\8)+1)).
+        at:byteIndexOfBitToSet
+        put:((newDigitBytes at:byteIndexOfBitToSet) setBit:(((index-1)\\8)+1)).
     ^ self class digitBytes:newDigitBytes sign:sign
 
     "
      TestCase assert:( 16r80000000 setBit:3  ) = 16r80000004
      TestCase assert:( 16r80000000 setBit:33 ) = 16r180000000
     "
+
+    "Modified (comment): / 21-11-2017 / 13:02:38 / cg"
 ! !
 
 !LargeInteger methodsFor:'bit operators-32bit'!