Date: Sat, 15 Feb 2025 06:44:01 +0000
Yeah, that doesn't make any sense to me either.
I don't understand what they were trying to do with it but it certainly doesn't look right.
________________________________
From: Std-Proposals <std-proposals-bounces_at_[hidden]socpp.org> on behalf of Ivan Matek via Std-Proposals <std-proposals_at_[hidden]>
Sent: Saturday, February 15, 2025 5:28:52 AM
To: std-proposals <std-proposals_at_lists.isocpp.org>
Cc: Ivan Matek <libbooze_at_[hidden]>
Subject: [std-proposals] Why is is_bounded != false required for digits10, but not for digits?
Hi everybody,
I may be misunderstanding something so first brief recap, then my question.
Current https://eel.is/c++draft/numeric.limits and C++26 draft say this:
static constexpr bool is_bounded;
true if the set of values representable by the type is finite.
[Note 3: All fundamental types ([basic.fundamental]) are bounded. This member would be false for arbitrary precision types. — end note]
Meaningful for all specializations.
Makes sense, it is important to know if type has infinite or finite number of values it can represent(here we obviously ignore fact of finite memory, etc).
But there is weird difference between digits and digits10 in terms of requirements:
digits:
(no requirements)
digits10:
Meaningful for all specializations in which is_bounded != false.
I find this confusing. In my mind only difference between the two is scaling factor and rounding. In other words:
T has supports for infinite digits ⇒ T has support for infinite digits10
so same requirement should apply for digits(i.e. that is_bounded != false).
If somebody is interested I checked what boost multiprecission reports and seems a bit inconsistent between cpp_int and gmp_int.
https://godbolt.org/z/n19sYxvdq
but in any case it is not super important since this is question about the standard.
I don't understand what they were trying to do with it but it certainly doesn't look right.
________________________________
From: Std-Proposals <std-proposals-bounces_at_[hidden]socpp.org> on behalf of Ivan Matek via Std-Proposals <std-proposals_at_[hidden]>
Sent: Saturday, February 15, 2025 5:28:52 AM
To: std-proposals <std-proposals_at_lists.isocpp.org>
Cc: Ivan Matek <libbooze_at_[hidden]>
Subject: [std-proposals] Why is is_bounded != false required for digits10, but not for digits?
Hi everybody,
I may be misunderstanding something so first brief recap, then my question.
Current https://eel.is/c++draft/numeric.limits and C++26 draft say this:
static constexpr bool is_bounded;
true if the set of values representable by the type is finite.
[Note 3: All fundamental types ([basic.fundamental]) are bounded. This member would be false for arbitrary precision types. — end note]
Meaningful for all specializations.
Makes sense, it is important to know if type has infinite or finite number of values it can represent(here we obviously ignore fact of finite memory, etc).
But there is weird difference between digits and digits10 in terms of requirements:
digits:
(no requirements)
digits10:
Meaningful for all specializations in which is_bounded != false.
I find this confusing. In my mind only difference between the two is scaling factor and rounding. In other words:
T has supports for infinite digits ⇒ T has support for infinite digits10
so same requirement should apply for digits(i.e. that is_bounded != false).
If somebody is interested I checked what boost multiprecission reports and seems a bit inconsistent between cpp_int and gmp_int.
https://godbolt.org/z/n19sYxvdq
but in any case it is not super important since this is question about the standard.
Received on 2025-02-15 06:44:04