arpfloat
arpfloat copied to clipboard
Performance & memory optimized?
I wonder (before diving into the implementation) if this lib employs efficiency optimizations as e.g. mpdecimal does?
E.g. if I will specify the float to be 8192 bits wide, then use it only to store IEEE754-exact numbers (i.e. those representable without any precision loss) and being in the interval 1.0
..10.0
(yes, this small), will it immediately allocate enormous amount of memory and then do the computation with all the bits or will it allocate some "minimum" and do only a fraction of all the computations?
In other words, does it support on demand allocation of memory?
Float<> is statically allocated to the maximum size. However, some algorithms (division at the moment) reduce the size of the word before performing the computation.
Thanks for clarification. Do you think it would make sense to implement such "deferred" incremental allocation? Or is it out of scope for this lib?
Maybe the decision to go with static allocation was not the right decision. I ran into trouble in operations that require higher precision and would benefit from dynamic extension of precision, which you can't easily do with static allocation.