Two more PRNGs implemented in Perl

In my ongoing quest to implement PRNGs in pure Perl I'm adding the Marsaglia multiply-with-carry family to my collection. These were a little difficult because the math is all done in 128bits which requires a special emulation layer in Perl. The Perl version is much slower than the C version, but that's to be expected without native 128bit variable types.

I also implemented squares64 PRNG which was a little more straight forward. I learned that bitwise shifts are normally unsigned, but if we're in a use integer block bitwise shifts change to signed. This is not what we want so I ended doing a lot of use integer followed almost immediately by a no integer to make sure we're doing the math in the correct mode.



Note: Replies will be formatted with PHP Markdown Extra syntax.

Name: Email (Not Required):
 
Logged IP: 216.73.216.59
To prevent spam please submit by clicking the kitten: