in reply to Re^14: PDL and srand puzzle - PDL non-thread testing
in thread PDL and srand puzzle
This exposes a PDL bug. That is PDL::srand/srandom has no effect and must call CORE::srand(N) instead for predictable output.Uh, no:
$ perl -Mblib -MPDL -E 'say $PDL::VERSION' 2.089_01 $ perl -Mblib -MPDL -E 'CORE::srand(4); say PDL->random' 0.437817146098168 $ perl -Mblib -MPDL -E 'CORE::srand(4); say PDL->random' 0.0596849513730282 $ perl -Mblib -MPDL -E 'CORE::srand(4); say PDL->random' 0.876085322091164 $ perl -Mblib -MPDL -E 'CORE::srand(4); say PDL->random' 0.0193676520337621 $ perl -Mblib -MPDL -E 'srandom(4); say PDL->random' 0.923230081572141 $ perl -Mblib -MPDL -E 'srandom(4); say PDL->random' 0.923230081572141 $ perl -Mblib -MPDL -E 'srandom(4); say PDL->random' 0.923230081572141 $ perl -Mblib -MPDL -E 'srandom(4); say PDL->random' 0.923230081572141
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^16: PDL and srand puzzle - PDL non-thread testing
by marioroy (Prior) on Jun 09, 2024 at 16:25 UTC | |
by etj (Priest) on Jun 10, 2024 at 10:49 UTC |