Class SmallInt


back
asLargeInteger | newValue n |
newValue <- List new.
n <- self abs.
[n > 0] whileTrue: [ newValue add: (n rem: 100). n <- n quo: 100].
newValue size = 0 ifTrue: [ newValue add: 0].
^ self < 0 ifTrue: [ LargeNegative new: newValue asByteArray]
ifFalse: [ LargePositive new: newValue asByteArray ]