Created on 2023-11-20.00:00:00 last changed 4 days ago
Proposed resolution (approved by CWG 2024-06-26):
Change in 6.8.6 [conv.rank] bullet 2.5 as follows:
- ...
- An extended floating-point type with the same set of values as more than one cv-unqualified standard floating-point type has a rank equal to the rank of double. [ Note: The treatment of std::float64_t differs from that of the analoguous _Float64 in C, for example on platforms where all of long double, double, and std::float64_t have the same set of values (see ISO/IEC 9899:2024 H.4.2). -- end note ]
CWG 2024-04-19
The name std::float64_t is not valid C. CWG resolved to adding a note to 6.8.6 [conv.rank] bullet 2.5 instead.
Additional notes (December, 2023)
The suggested resolution would make a conversion from std::float64_t to double not implicit, which is not desirable.
David Olsen, one of the authors of P1467, asserts that the deviation from C is intentional, and was discussed with the C floating-point study group.
Forwarding to EWG via paper issue 1699 to confirm that the deviation from C is intentional and thus an Annex C entry should be created.
EWG 2024-03-18
This issue should be closed as NAD.
Possible resolution [SUPERSEDED]:
Add a new paragraph in C.7.3 [diff.basic] as follows:
Affected subclause: 6.8.6 [conv.rank]
Change: Conversion rank of same-sized long double vs. std::float64_t
Rationale: Provide implicit conversion from std::float64_t to double.
Effect on original feature: Change of semantically well-defined feature.
Difficulty of converting: Trivial: explicitly convert to the desired type.
How widely used: Rarely.
Suggested resolution [SUPERSEDED]:
Change in 6.8.6 [conv.rank] bullet 2.5 as follows:
- ...
- An extended floating-point type with the same set of values as more than one cv-unqualified standard floating-point type has a rank equal to the highest rank
of doubleamong such types.
[Accepted as a DR at the June, 2024 meeting.]
Consider:
auto f(long double x, std::float64_t y) { return x + y; }
What is the return type of f?
Suppose an implementation uses the same size and semantics for all of double, long double, and std::float64_t. C23 prefers the IEEE interchange type (i.e. std::float64_t) over long double and double. In contrast, C++ chooses long double, which has a higher rank than double, but std::float64_t is specified to have the same rank as double.
This outcome conflicts with the documented goal of P1467 that C++ and C conversion rules be aligned.
History | |||
---|---|---|---|
Date | User | Action | Args |
2024-12-17 09:54:02 | admin | set | status: dr -> drwp |
2024-07-20 13:52:34 | admin | set | status: ready -> dr |
2024-06-26 19:00:47 | admin | set | status: tentatively ready -> ready |
2024-05-04 21:20:44 | admin | set | messages: + msg7687 |
2024-05-04 21:20:44 | admin | set | status: review -> tentatively ready |
2024-04-19 21:17:21 | admin | set | messages: + msg7669 |
2024-03-18 12:50:42 | admin | set | status: open -> review |
2023-12-03 22:09:25 | admin | set | messages: + msg7549 |
2023-12-03 15:08:26 | admin | set | messages: + msg7546 |
2023-11-20 00:00:00 | admin | create |