C++ Logo

std-proposals

Advanced search

Re: [std-proposals] D4037R0 Allowing signed char and unsigned char in random number generation

From: Bjorn Reese <breese_at_[hidden]>
Date: Thu, 26 Feb 2026 21:52:12 +0100
On 2/26/26 21:26, Jan Schultke wrote:

> Exactly as specified in the standard? For generators, I'm pretty sure
> it's specified mathematically what they produce with perfect clarity.

Although the various random generators are configurable, every possible
configuration does not result in good random generators. The specialized
random engines (e.g. mt19937) have been chosen very carefully, and are
backed by peer-reviewd papers certifying their randomness.

I have yet to see any good randomness results from 8-bit (or 16-bit)
random generators.

If you want these implementations to use 32-bit random generators under
the hood, then maybe we are better off with a "downcasting" random
adaptor.

Received on 2026-02-26 20:52:20