[Bug libstdc++/51795] linear_congruential_engine doesn't work correctly

marc.glisse at normalesup dot org gcc-bugzilla@gcc.gnu.org
Fri Jan 27 13:42:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51795

--- Comment #11 from Marc Glisse <marc.glisse at normalesup dot org> 2012-01-27 13:12:05 UTC ---
(In reply to comment #10)
> Really, I don't think the intent here is involving arbitrary size integers.
> This stuff must be quick, and all the integers are unsigned. I don't think we
> have here something like the templates in time, really.

But if we round first modulo 2^64 then modulo m, it isn't the linear
congruential algorithm it is supposed to be. I think I'd prefer for the
compiler to reject the code when used with values that would make the generator
too slow.

Let me ask on the reflector, to be sure.



More information about the Gcc-bugs mailing list