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

Improve efficiency of divmod helper method get_max_shift() #108

Open saxbophone opened 2 years ago

saxbophone commented 2 years ago

This loop was introduced into this method in #107 to fix a bug, but constitutes a potential performance bottleneck due to the repeated multiplication in the loop predicate: https://github.com/saxbophone/arby/blob/ca58d11dc79148e1b08633f3cfc169f7279457be/arby/include/arby/Nat.hpp#L534-L537