Skip to content

Commit

Permalink
Math-Random-MT-Auto v1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhedden committed Apr 22, 2016
1 parent 6088ef7 commit 0411c92
Show file tree
Hide file tree
Showing 5 changed files with 192 additions and 59 deletions.
7 changes: 6 additions & 1 deletion Changes
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
Revision history for Perl extension Math::Random::MT::Auto.

1.22 Tue Jul 05 14:43:30 2005
- Subclass handling and documentation
- Fix for thread cloning for 5.7.2-5.8.6
- Documented as not thread-safe for < 5.7.2

1.21 Fri Jul 01 14:43:30 2005
- Added gaussian() - Gaussian (normal) distributed random numbers
- improved testing
- Improved testing
- POD fixups

1.20 Thu Jun 30 14:22:45 2005
Expand Down
12 changes: 6 additions & 6 deletions MRMA.xs
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,13 @@ OO_prng()
RETVAL

U32
rand32(rand_obj);
rand32(rand_obj)
HV *rand_obj
INIT:
CODE:
/* Extract PRNG context from object */
IV tmp = SvIV((SV*)SvRV(*hv_fetch(rand_obj, "PRNG", 4, 0)));
my_cxt_t *prng = INT2PTR(my_cxt_t *, tmp);
CODE:

/* Random number on [0,0xFFFFFFFF] interval */
RETVAL = (--prng->left == 0) ? _mt_algo(prng)
: *prng->next++;
Expand All @@ -263,13 +263,13 @@ rand32(rand_obj);
RETVAL

double
rand(rand_obj, ...);
rand(rand_obj, ...)
HV *rand_obj
INIT:
CODE:
/* Extract PRNG context from object */
IV tmp = SvIV((SV*)SvRV(*hv_fetch(rand_obj, "PRNG", 4, 0)));
my_cxt_t *prng = INT2PTR(my_cxt_t *, tmp);
CODE:

/* Random number on [0,1) interval */
U32 rand = (--prng->left == 0) ? _mt_algo(prng)
: *prng->next++;
Expand Down
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Math-Random-MT-Auto version 1.21
Math-Random-MT-Auto version 1.22
================================

This module provides two random number functions (rand32 and a
Expand Down
Loading

0 comments on commit 0411c92

Please sign in to comment.