summaryrefslogtreecommitdiff
path: root/ext/standard/lcg.c
diff options
context:
space:
mode:
authorJeroen van Wolffelaar <jeroen@php.net>2001-09-03 01:06:23 +0000
committerJeroen van Wolffelaar <jeroen@php.net>2001-09-03 01:06:23 +0000
commitf7306ce0109b246ff23901ed6b91d58de4c9dd42 (patch)
treeae671af313651abee6fe81dee1f84b5f7ab1ca25 /ext/standard/lcg.c
parentd4197ea703cef9f1cf6afd7065b4cab9af4a898c (diff)
downloadphp-git-f7306ce0109b246ff23901ed6b91d58de4c9dd42.tar.gz
Merge RAND_REDESIGN into MAIN
Diffstat (limited to 'ext/standard/lcg.c')
-rw-r--r--ext/standard/lcg.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/standard/lcg.c b/ext/standard/lcg.c
index 7ae45a0ef0..f211317d73 100644
--- a/ext/standard/lcg.c
+++ b/ext/standard/lcg.c
@@ -42,6 +42,11 @@ static int php_lcg_initialized = 0;
* The function combines two CGs with periods of
* 2^31 - 85 and 2^31 - 249. The period of this function
* is equal to the product of both primes.
+ *
+ * There are only about 65k distinct starting values, that's
+ * not much... If PHP is running as CGI, randomness is quite bad.
+ * If it is run as a module, it's long-livin', so no problem in that
+ * case.
*/
#define MODMULT(a, b, c, m, s) q = s/a;s=b*(s-a*q)-c*q;if(s<0)s+=m
@@ -103,5 +108,5 @@ PHP_FUNCTION(lcg_value)
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 tw=78 fdm=marker
- * vim<600: sw=4 ts=4 tw=78
+ * vim<600: sw=8 ts=8 tw=78
*/