Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2025-01-21 20:02:42


Ivan Matek wrote:
> For me the interesting thing about comparisons beside Peter improvements is
> that benefits from normalization seem to depend on how many times user
> does certain operation.
>
> user does
> auto x = a * b * c * d * e;
> x < y;

Multiplication probably won't suffer much, but addition with different signs
might take quite a hit because of normalization of the result.

One could in theory engage the type system here and make operator+ for
decimal64_fast return decimal64_fast_non_normalized, which will then
only be normalized once on the final store to x.

Who knows whether this will be worth doing or not, perf-wise.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk