C++ Logo

std-proposals

Advanced search

Re: [std-proposals] solution proposal for Issue 2524: generate_canonical can occasionally return 1.0

From: Jonathan Wakely <cxx_at_[hidden]>
Date: Sun, 7 Dec 2025 18:04:55 +0000
On Sun, 7 Dec 2025, 15:04 Juan Lucas Rey, <juanlucasrey_at_[hidden]> wrote:

>
> Also something that is confusing to me from this process is that, if the
> standard specifies that the return values from generate_canonical are to be
> smaller than 1, then why is the standard concerned with implementation
> problems? why does LWG 2525 even exist? If the standard says it should
> return values in [0,1), and implementations don’t respect that, then that’s
> hardly a problem of the standard right?
>
> That seems to be an implementation problem, and is properly addressed at
> the implementation level by GCC #63176
> <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63176>
>

The GCC solution is non-conforming. We are implementing p0952 as a better
solution.

 LLVM #18767 <https://bugs.llvm.org/show_bug.cgi?id=18767>
>

This isn't fixed yet, as far as I know.


and MSVC STL #1074 <https://github.com/microsoft/STL/issues/1074>.
>

The MSVC solution was to implement p0952 which means it is not conforming
to the old spec, because it sometimes discards random numbers.

So it's not just an implementation problem if the spec is implementable,
and so implementations can only be fixed by either breaking the rules of
the standard or changing the standard.

Received on 2025-12-07 18:05:14