Skip Menu |

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

Report information
The Basics
Id: 73298
Status: resolved
Priority: 0/
Queue: Math-Random-MT

People
Owner: Nobody in particular
Requestors: crew [...] cs.stanford.edu
Cc:
AdminCc:

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



Subject: irand
most random number generators have an irand() method that returns a uniformly distributed 0..2^32-1 integer, which is much more useful in cryptographic contexts. It would be trivial to move the float conversion out of mt_genrand so that it returns return uint32 for irand() and then have another routine normalize it into a [0..1] float for rand(). Yeah, I know I could just do int(4294967296*rand), but (1) slower (2) harder to get right if int is not truncating the right way, and (3) rather a waste given that mt_genrand already does what we want...
Hi, Thanks for the report. Your suggestion has been implemented in Math::Random::MT version 1.15. Florent