
21 Jan
2025
21 Jan
'25
8:02 p.m.
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.