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

Store digits using more efficient container #133

Open saxbophone opened 1 year ago

saxbophone commented 1 year ago

We should stop using our custom-built storage type a linked list for the digits, vector is constexpr on many platforms now and it's probably faster than the hand-built structure we have been using let's use a constexpr deque implementation instead.

saxbophone commented 1 year ago

I recently rewrote my "shifted array (sharray)" implementation to be fully working. It's inspired by the standard library's deque but implemented in a simpler way. It gives $\mathcal{O}(1)$ random access and amortised $\mathcal{O}(1)$ push and pop at front and back. It's convenient for arby if we can retain the ability to quickly push and pop digits at either end, perhaps we should perfect that container we've built, rather than use vector.