Boost logo

Boost :

From: Fernando Pelliccioni (fpelliccioni_at_[hidden])
Date: 2025-01-20 19:29:18


On Wed, Jan 15, 2025 at 10:34 AM John Maddock via Boost <
boost_at_[hidden]> wrote:

> The review of the proposed Decimal Number library by Matt Borland and
> Chris Kormanyos begins today and runs until 22nd Jan.
>
> You will find documentation here:
> https://cppalliance.org/decimal/decimal.html
>
> And the code repository is here: https://github.com/cppalliance/decimal/
>
>
>
Hi everyone,

First of all, a big thank you to Matt and Chris for your hard work, I
personally find this library very useful.
Here are a few quick comments:

1. Literals
I agree with earlier suggestions about placing them in a separate
namespace, such as boost::decimal::literals, rather than boost::decimal.
This matches typical Boost conventions.

2. Headers
I also concur with the feedback regarding compile times. Relying
exclusively on <boost/decimal.hpp> can be slow. Please provide smaller
headers.

3. Fast vs. Non-Fast Variants
I think the authors’ choice of default is probably fine, though I’m not
100% certain. In any case, clearer documentation on when to pick the
standard type vs. the fast variant would be really helpful. Some guidance
on weighing storage vs. speed would benefit end users.

4. <cstdio> Support
I share the concerns about potentially unsafe functions and limited
specifier support. Maybe focusing on <format> (for C++20) or a safer,
custom formatter would be more straightforward and less error-prone.

5. Concepts
If the Concepts defined here are intended for user code, I agree they
should be public and documented. I would like to use them in my C++20 (and
beyond) code.

6. Hardware Decimal Support
I don't see explicit mention of how this library could leverage hardware
decimal capabilities, but I imagine that could be added in the future,
possibly via a pull request from someone who has access to that hardware.
It is a nice to have feature but not a must have. I would not stop the
library from being released without it.

7. Compiler-Explorer support
It would be great if this library was supported on Compiler-Explorer for
doing some testing. I know it is not related to the library but it helps a
lot for reviewing it.

8. Benchmarks
I plan to run some additional benchmarks on my own machines.
One thing I'm curious about is how the built-in GCC _Decimal32/_Decimal64
types compare. Do they behave more like the "standard" or the fast variants
in practice?

Thanks again! I think this library is shaping up wonderfully and can't wait
to see how it evolves.

Best,
Fernando


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