--- a/LargeInteger.st Mon Apr 25 16:19:00 2016 +0200
+++ b/LargeInteger.st Tue Apr 26 15:44:03 2016 +0200
@@ -238,7 +238,7 @@
digitBytes:aByteArrayOfDigits
"create and return a new LargeInteger with digits (lsb-first)
from the argument, aByteArray.
- Experimental interface - May change/be removed without notice."
+ The byteArray argument provides the unsigned magnitude in lsb-first order."
^ self basicNew setDigits:aByteArrayOfDigits
@@ -252,7 +252,8 @@
digitBytes:aByteArrayOfDigits MSB:msb
"create and return a new LargeInteger with digits (which may be in either msb/lsb order)
- from the argument, aByteArray."
+ from the argument, aByteArray.
+ The byteArray argument provides the unsigned magnitude in the specified byte order."
|digits|
@@ -270,9 +271,9 @@
!
digitBytes:aByteArrayOfDigits sign:sign
- "create and return a new LargeInteger with digits (lsb-first)
+ "create and return a new sign-magnitude LargeInteger with digits (lsb-first)
from the argument, aByteArray.
- Experimental interface - May change/be removed without notice."
+ The byteArray argument provides the unsigned magnitude in lsb-first order."
^ self basicNew setDigits:aByteArrayOfDigits sign:sign
@@ -314,6 +315,8 @@
"Modified: / 8.5.1998 / 21:40:41 / cg"
! !
+
+
!LargeInteger class methodsFor:'queries'!
isBuiltInClass
@@ -5499,23 +5502,29 @@
!
numberOfDigits:nDigits
-"/ digitByteArray := ByteArray uninitializedNew:nDigits.
+ "allocate space for nDigits bytes of magnitude"
+
digitByteArray := ByteArray new:nDigits.
sign := 1.
!
numberOfDigits:nDigits sign:newSign
-"/ digitByteArray := ByteArray uninitializedNew:nDigits.
+ "allocate space for nDigits bytes of magnitude"
+
digitByteArray := ByteArray new:nDigits.
sign := newSign.
!
setDigits:digits
+ "set the digits from the lsb-ordered digit-bytes"
+
digitByteArray := digits.
sign := 1.
!
setDigits:digits sign:newSign
+ "set the digits from the lsb-ordered digit-bytes"
+
digitByteArray := digits.
sign := newSign.
!