Class LargePositive


back
subtractFromLP: arg  | borrow newValue |
" private internal method, know we are smaller than arg "
borrow <- 0. newValue <- List new.
arg values with: values pad: 0 do:
[ :lv :rv | lv <- lv - borrow.
(lv < rv) ifTrue: [ lv <- lv + 100. borrow <- 1] ifFalse: [ borrow <- 0].
newValue add: (lv - rv)].
^ LargePositive new: newValue asByteArray