not with Pharo5:
((LargePositiveInteger new: 3) digitAdd: SmallInteger maxVal - 10) class
=> SmallInteger
That's a very recent change to the LargeInteger primitives, wasn't in my old spur vm (a month old perhaps).
So,in addition to #digitAdd: being 3 times slower than #+ (...jittability? Shouldn't be *that* much more work to add a byte to another byte compared to whatever #+ does)
nor is it hitting the fast path for replaceFrom:.. (2 variableX instances) either, meaning it'll see an even bigger improvement from reverting compared to Pharo4 (which got 50% faster...)
'
cool! Change looks good but please remove the obsolete >>#digitAdd: comment.
thanks a lot!!
Done, published as .47
Tested counter increments and reset at image startup, seemed to work at least.
Cheers,
Henry