Lines Matching refs:min
312 …_random_range(const php_random_algo *algo, php_random_status *status, zend_long min, zend_long max) in php_random_range() argument
314 zend_ulong umax = (zend_ulong) max - (zend_ulong) min; in php_random_range()
317 return (zend_long) (rand_range64(algo, status, umax) + min); in php_random_range()
320 return (zend_long) (rand_range32(algo, status, umax) + min); in php_random_range()
443 PHPAPI zend_long php_mt_rand_range(zend_long min, zend_long max) argument
445 return php_random_algo_mt19937.range(php_random_default_status(), min, max);
451 PHPAPI zend_long php_mt_rand_common(zend_long min, zend_long max) argument
457 return php_mt_rand_range(min, max);
465 zend_ulong offset = (double) ( (double) max - min + 1.0) * (r / (PHP_MT_RAND_MAX + 1.0));
467 return (zend_long) (offset + min);
626 PHPAPI int php_random_int(zend_long min, zend_long max, zend_long *result, bool should_throw) argument
631 if (min == max) {
632 *result = min;
636 umax = (zend_ulong) max - (zend_ulong) min;
664 *result = (zend_long)((trial % umax) + min);
712 zend_long min, max; local
721 Z_PARAM_LONG(min)
725 if (UNEXPECTED(max < min)) {
730 RETURN_LONG(php_mt_rand_common(min, max));
750 zend_long min, max; local
759 Z_PARAM_LONG(min)
763 if (max < min) {
764 RETURN_LONG(php_mt_rand_common(max, min));
767 RETURN_LONG(php_mt_rand_common(min, max));
802 zend_long min, max, result; local
805 Z_PARAM_LONG(min)
809 if (min > max) {
814 if (php_random_int_throw(min, max, &result) == FAILURE) {