summaryrefslogtreecommitdiff
path: root/ext/standard/php_rand.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/php_rand.h')
-rw-r--r--ext/standard/php_rand.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/standard/php_rand.h b/ext/standard/php_rand.h
index 76a368484d..506e4976a6 100644
--- a/ext/standard/php_rand.h
+++ b/ext/standard/php_rand.h
@@ -60,6 +60,9 @@
*
* -RL
*/
+#define RAND_RANGE_BADSCALING(__n, __min, __max, __tmax) \
+ (__n) = (__min) + (zend_long) ((double) ( (double) (__max) - (__min) + 1.0) * ((__n) / ((__tmax) + 1.0)))
+
#define RAND_RANGE(__n, __min, __max, __tmax) \
(__n) = php_mt_rand_range((__min), (__max))