in reply to how portable is the random number generator?

Perl rand() uses C drand48() or if that isn't available C rand().

In the definition of both of these the algorithm is not defined, only the interface is.

A few good fast generator that can repeat exact sequences given big seeds is the Mersenne Twister.

  • Comment on Re: how portable is the random number generator?

Replies are listed 'Best First'.
Re^2: how portable is the random number generator?
by choroba (Cardinal) on Jan 25, 2026 at 22:39 UTC
    As was already mentioned, this is no longer true. Perl has used its own implementation of drand48 since 5.20.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]