Skip Menu |

This queue is for tickets about the Math-Random-MT CPAN distribution.

Report information
The Basics
Id: 74173
Status: new
Priority: 0/
Queue: Math-Random-MT

People
Owner: Nobody in particular
Requestors: florent.angly [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.13
Fixed in: (no value)



Subject: Return value of srand(undef)
I accidentally stumbled upon this oddity. There currently is a discrepancy between what Math::Random::MT and Perl return when seeding srand() with undef: $ perl -e 'use Math::Random::MT qw(srand); print srand(undef)."\n";' 460165133 $ perl -e 'print srand(undef)."\n";' 0 but true '0 but true' is a special Perl string that evaluates as true but also behaves as the number zero. I am not sure why srand(undef) does not return a proper seed instead of this value. If there is a good reason, then Math::Random::MT should probably also ensure that it returns '0 but true' when needed. Florent