Lines Matching refs:umax
80 PHPAPI uint32_t php_random_range32(php_random_algo_with_state engine, uint32_t umax) in php_random_range32() argument
100 if (UNEXPECTED(umax == UINT32_MAX)) { in php_random_range32()
105 umax++; in php_random_range32()
108 if ((umax & (umax - 1)) == 0) { in php_random_range32()
109 return result & (umax - 1); in php_random_range32()
113 uint32_t limit = UINT32_MAX - (UINT32_MAX % umax) - 1; in php_random_range32()
136 return result % umax; in php_random_range32()
139 PHPAPI uint64_t php_random_range64(php_random_algo_with_state engine, uint64_t umax) in php_random_range64() argument
159 if (UNEXPECTED(umax == UINT64_MAX)) { in php_random_range64()
164 umax++; in php_random_range64()
167 if ((umax & (umax - 1)) == 0) { in php_random_range64()
168 return result & (umax - 1); in php_random_range64()
172 uint64_t limit = UINT64_MAX - (UINT64_MAX % umax) - 1; in php_random_range64()
195 return result % umax; in php_random_range64()
295 zend_ulong umax = (zend_ulong) max - (zend_ulong) min; in php_random_range() local
297 if (umax > UINT32_MAX) { in php_random_range()
298 return (zend_long) (php_random_range64(engine, umax) + min); in php_random_range()
301 return (zend_long) (php_random_range32(engine, umax) + min); in php_random_range()