attaswift / BigInt

Arbitrary-precision arithmetic in pure Swift
MIT License
764 stars 107 forks source link

Decimal init performance #123

Closed mredig closed 2 weeks ago

mredig commented 2 weeks ago

Well I figured out how signifcands and exponents work.... Or at least well enough to make the initializer much faster now.

I added a test to use the largest and smallest Decimal values as extreme cases and, while I don't know how long it took with the old method, it was longer than walking away and coming back to the computer. Now it's a fraction of a second.

I also made a quick safety fix to a buffer method since I caught it right after my last contribution.

tgymnich commented 2 weeks ago

Awesome thank you. Left a few ideas for future improvements.