Lines Matching refs:umax
91 …inline uint32_t rand_range32(const php_random_algo *algo, php_random_status *status, uint32_t umax) in rand_range32() argument
109 if (UNEXPECTED(umax == UINT32_MAX)) { in rand_range32()
114 umax++; in rand_range32()
117 if ((umax & (umax - 1)) == 0) { in rand_range32()
118 return result & (umax - 1); in rand_range32()
122 limit = UINT32_MAX - (UINT32_MAX % umax) - 1; in rand_range32()
144 return result % umax; in rand_range32()
147 …inline uint64_t rand_range64(const php_random_algo *algo, php_random_status *status, uint64_t umax) in rand_range64() argument
165 if (UNEXPECTED(umax == UINT64_MAX)) { in rand_range64()
170 umax++; in rand_range64()
173 if ((umax & (umax - 1)) == 0) { in rand_range64()
174 return result & (umax - 1); in rand_range64()
178 limit = UINT64_MAX - (UINT64_MAX % umax) - 1; in rand_range64()
200 return result % umax; in rand_range64()
314 zend_ulong umax = (zend_ulong) max - (zend_ulong) min; in php_random_range() local
316 if (umax > UINT32_MAX) { 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()
628 zend_ulong umax; local
636 umax = (zend_ulong) max - (zend_ulong) min;
643 if (umax == ZEND_ULONG_MAX) {
649 umax++;
652 if ((umax & (umax - 1)) != 0) {
654 zend_ulong limit = ZEND_ULONG_MAX - (ZEND_ULONG_MAX % umax) - 1;
664 *result = (zend_long)((trial % umax) + min);