saxbophone / arby

Arbitrary precision arithmetic in C++, even at compile-time
https://saxbophone.com/arby/
Mozilla Public License 2.0
8 stars 1 forks source link

Optimise multiplication and division by powers of two #132

Closed saxbophone closed 1 year ago

saxbophone commented 1 year ago

Now when powers of two are detected, bit-shifting is used instead. This theoretically induces a performance benefit, although I have not detected any when running the test suite locally. It is possible such benefits will only present in certain situations. It might also be that my hand-coded data structure for storing the digits is not that efficient, so maybe when we switch to std::vector, we will reap greater benefits.

Closes #43