diff options
author | kusano <kusano@users.noreply.github.com> | 2015-12-17 19:26:38 +0900 |
---|---|---|
committer | kusano <kusano@users.noreply.github.com> | 2015-12-18 04:14:40 +0900 |
commit | d31e8a9a85efea54db0b647424f6c4485d71db8b (patch) | |
tree | 5b0ab8c40ed9df9f913ede2abe461e8ea93542e0 /ext/standard/rand.c | |
parent | 817ed01320cd0c6ce3d36b06d760d91a748f1a56 (diff) | |
download | php-git-d31e8a9a85efea54db0b647424f6c4485d71db8b.tar.gz |
Fix #71152: mt_rand() returns the different values from original mt19937ar.c
Diffstat (limited to 'ext/standard/rand.c')
-rw-r--r-- | ext/standard/rand.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/standard/rand.c b/ext/standard/rand.c index b80318c4b2..9ec724186b 100644 --- a/ext/standard/rand.c +++ b/ext/standard/rand.c @@ -146,7 +146,7 @@ PHPAPI zend_long php_rand(void) #define loBits(u) ((u) & 0x7FFFFFFFU) /* mask the highest bit of u */ #define mixBits(u, v) (hiBit(u)|loBits(v)) /* move hi bit of u to hi bit of v */ -#define twist(m,u,v) (m ^ (mixBits(u,v)>>1) ^ ((php_uint32)(-(php_int32)(loBit(u))) & 0x9908b0dfU)) +#define twist(m,u,v) (m ^ (mixBits(u,v)>>1) ^ ((php_uint32)(-(php_int32)(loBit(v))) & 0x9908b0dfU)) /* {{{ php_mt_initialize */ |