[Bug libstdc++/88935] std::random_shuffle does not work if the sequence is longer than RAND_MAX elements

2024-08-23 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88935 Jonathan Wakely changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Bug libstdc++/88935] std::random_shuffle does not work if the sequence is longer than RAND_MAX elements

2024-08-23 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88935 --- Comment #14 from GCC Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:125bab23ad75449333983c9389898c5b92b3aa0d commit r15-3129-g125bab23ad75449333983c9389898c5b92b3aa0d Author: Giovanni Bajo Date:

[Bug libstdc++/88935] std::random_shuffle does not work if the sequence is longer than RAND_MAX elements

2024-07-31 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88935 Jonathan Wakely changed: What|Removed |Added Target Milestone|--- |15.0

[Bug libstdc++/88935] std::random_shuffle does not work if the sequence is longer than RAND_MAX elements

2024-06-19 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88935 --- Comment #13 from Jonathan Wakely --- std::random_shuffle was removed from the C++ standard years ago, precisely because it uses low quality randomness. So it's not a high priority to fix something that is no longer even in the standard, becau

[Bug libstdc++/88935] std::random_shuffle does not work if the sequence is longer than RAND_MAX elements

2024-06-18 Thread agriff at tin dot it via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88935 Andrea Griffini changed: What|Removed |Added CC||agriff at tin dot it --- Comment #12 f

[Bug libstdc++/88935] std::random_shuffle does not work if the sequence is longer than RAND_MAX elements

2024-01-16 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88935 --- Comment #11 from Jonathan Wakely --- Yes, but in practice that's not the problem with mingw. The problem is the low RAND_MAX. The distribution within the range of numbers produced is acceptable. Good enough for std::random_shuffle anyway.

[Bug libstdc++/88935] std::random_shuffle does not work if the sequence is longer than RAND_MAX elements

2024-01-16 Thread xry111 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88935 --- Comment #10 from Xi Ruoyao --- (In reply to Jonathan Wakely from comment #9) > (In reply to Xi Ruoyao from comment #7) > > The C++11 standard explicitly allows to use rand() as the random source for > > random_shuffle, thus this is not a bug

[Bug libstdc++/88935] std::random_shuffle does not work if the sequence is longer than RAND_MAX elements

2024-01-16 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88935 Jonathan Wakely changed: What|Removed |Added Severity|enhancement |normal

[Bug libstdc++/88935] std::random_shuffle does not work if the sequence is longer than RAND_MAX elements

2024-01-16 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88935 --- Comment #9 from Jonathan Wakely --- (In reply to Xi Ruoyao from comment #7) > The C++11 standard explicitly allows to use rand() as the random source for > random_shuffle, thus this is not a bug but an enhancement. It doesn't just allow it,

[Bug libstdc++/88935] std::random_shuffle does not work if the sequence is longer than RAND_MAX elements

2024-01-16 Thread xry111 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88935 --- Comment #8 from Xi Ruoyao --- (In reply to Xi Ruoyao from comment #7) > The C++11 standard explicitly allows to use rand() as the random source for > random_shuffle, thus this is not a bug but an enhancement. > > As random_shuffle is depreca

[Bug libstdc++/88935] std::random_shuffle does not work if the sequence is longer than RAND_MAX elements

2024-01-16 Thread xry111 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88935 Xi Ruoyao changed: What|Removed |Added Severity|normal |enhancement CC|

[Bug libstdc++/88935] std::random_shuffle does not work if the sequence is longer than RAND_MAX elements

2019-01-21 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88935 Jonathan Wakely changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug libstdc++/88935] std::random_shuffle does not work if the sequence is longer than RAND_MAX elements

2019-01-20 Thread giovannibajo at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88935 --- Comment #6 from Giovanni Bajo --- A patch has been posted here: https://gcc.gnu.org/ml/libstdc++/2018-12/msg00038.html

[Bug libstdc++/88935] std::random_shuffle does not work if the sequence is longer than RAND_MAX elements

2019-01-20 Thread giovannibajo at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88935 --- Comment #5 from Giovanni Bajo --- Created attachment 45474 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45474&action=edit Chart generated by chart.cpp that highlights broken distribution

[Bug libstdc++/88935] std::random_shuffle does not work if the sequence is longer than RAND_MAX elements

2019-01-20 Thread giovannibajo at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88935 --- Comment #4 from Giovanni Bajo --- Created attachment 45473 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45473&action=edit What test.cpp actually does output with std::random_shuffle

[Bug libstdc++/88935] std::random_shuffle does not work if the sequence is longer than RAND_MAX elements

2019-01-20 Thread giovannibajo at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88935 --- Comment #3 from Giovanni Bajo --- Created attachment 45472 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45472&action=edit What test.cpp should output if random_shuffle worked

[Bug libstdc++/88935] std::random_shuffle does not work if the sequence is longer than RAND_MAX elements

2019-01-20 Thread giovannibajo at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88935 --- Comment #2 from Giovanni Bajo --- Created attachment 45471 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45471&action=edit Test code to draw a chart of distributions

[Bug libstdc++/88935] std::random_shuffle does not work if the sequence is longer than RAND_MAX elements

2019-01-20 Thread giovannibajo at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88935 --- Comment #1 from Giovanni Bajo --- Created attachment 45470 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45470&action=edit Test code to reproduce bug