C++ Logo

std-proposals

Advanced search

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

From: Simon Schröder <dr.simon.schroeder_at_[hidden]>
Date: Mon, 8 Dec 2025 07:09:50 +0100
> On Dec 7, 2025, at 8:11 PM, Marcin Jaczewski via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> If we need to break implementations by changing standard, could the
> standard at least require exact same results on every implementation?
>
I’m not sure if this is really the task of the standard. I think it is sufficient for the standard to provide a random number generator. If we prescribe too much we are closed off to improvements of random number generators. If you have non-standard requirements towards the random number generator use a different library that provides what you need. In fact I would claim that very few people know how to use a random number generator correctly (especially how to properly seed a random number generator). If I’m not mistaken there are only about a handful of different seeds for the Mersenne Twister that are proven to generate a truly uniform distribution. If you want a deep dive into random number generators, look at the TINA RNG and their papers.

Received on 2025-12-08 06:10:06