返回集合中，值(分数)在min和max之间(默认包括值等于min或max)的成员数量
@param $min mixed 排序值
@param $max mixed 排序值
@return int 元素个数
764892
public function countByValue($min = '-inf', $max = '+inf'): int
    {
        return $this->handle->zCount($this->name, strval($min), strval($max));
    }
363183
public function getRandomNumber($min = -1, $max = -1) {
		if ($this->nextRandomNumber >= 0 && $this->nextRandomNumber >= ($min == -1 ? 0 : $min) && $this->nextRandomNumber <= ($max == -1 ? $this->getMaxRandomNumber() : $max)) {
			$rand = $this->nextRandomNumber;
			$this->nextRandomNumber = -1;

			return $rand;
		}

		return $this->realRandom->getRandomNumber($min, $max);
	}
1075220
public function rand($min = 0, $max = 0)
	{
		if (!$max)
			$max = getrandmax();

		return $this->registry()->isRegistered(self::REGISTRY_RAND)
			? $this->lookup(self::REGISTRY_RAND)
			: rand($min, $max);
	}
1251880
public static function random($min, $max = null)
    {
        if (String::isEmpty($max) ||
            $max > getrandmax()) {
            $max = getrandmax();
        }

        return rand($min, $max);
    }
280003
public function min($min=null)
    {
        $min = LambdaUtils::toSelectCallable($min);
        $temp = $this->select($min)->toArray();
        return min($temp);
    }
558031
public static function random($min, $max) {
        $max += 1;
        $range = $max - $min;
        if ($range == 0) return $min; // not so random...
        $log = log($range, 2);
        $bytes = (int) ($log / 8) + 1; // length in bytes
        $bits = (int) $log + 1; // length in bits
        $filter = (int) (1 << $bits) - 1; // set all lower bits to 1
        do {
            $rnd = hexdec(bin2hex(openssl_random_pseudo_bytes($bytes, $s)));
            $rnd = $rnd & $filter; // discard irrelevant bits
        } while ($rnd >= $range);
        return $min + $rnd;
    }
918370
protected function rand($min, $max)
    {
        if (!is_array($this->fingerprint)) {
            $this->fingerprint = array();
        }

        if ($this->useFingerprint) {
            $value = current($this->fingerprint);
            next($this->fingerprint);
        } else {
            $value = mt_rand($min, $max);
            $this->fingerprint[] = $value;
        }

        return $value;
    }
805214
public function between($min, $max) {
        $this->check_role = 'between';
        $this->p1 = $min;
        $this->p2 = $max;
        $result = $this->value >= $min && $this->value <= $max;
        $this->checkResult($result);
        return $this;
    }
560616
protected function random(float $min, float $max) : float
    {
        return ($min + lcg_value() * (abs($max - $min)));
    }
564487
public static void checkMinMax(int min, int max) {
    checkMin(min);
    checkMax(max);
    checkArgument(min <= max, "min > max");
  }
297970
public function minMax($min, $max=PHP_INT_MAX){
        return $this->markErrorIf($this->value < $min || $this->value > $max);
    }
912384
private function isValidResult($number, $min, $max)
    {
        return is_int($number) && $number >= $min && $number <= $max;
    }
1186190
public function getInt($min = 0, $max = 2147483647)
    {
        /** @noinspection TypeUnsafeComparisonInspection */
        if ($min == $max) {
            return $min;
        } else {
            $ar = unpack('l', $this->getByte(4));
            return $min + abs($ar[1]) % ($max - $min + 1);
        }
    }
505103
public function countArray($min, $max = PHP_INT_MAX)
    {
        return $this->markErrorIf(!is_array($this->value)||count($this->value) < $min || count($this->value) > $max, false);
    }
64900
public static function number($min = PHP_INT_MIN, $max = PHP_INT_MAX, $precision = 2)
    {
        return round($min + mt_rand() / mt_getrandmax() * ($max - $min), $precision);
    }
1001440
public static function length($value, $min = null, $max = null)
    {
        $length = mb_strlen($value);

        if (is_numeric($min) && $min > 0 && $length < $min) {
            return false;
        }

        if (is_numeric($max) && $max > 0 && $length > $max) {
            return false;
        }

        return true;
    }
395521
public function range(int $min=null, int $max=null)
        {
                $min      = is_null($min) ? '-inf' : $min;
                $max      = is_null($max) ? '+inf' : $max;
           
                $response = $this->_redis->zrevrangebyscore($this->_key, $max, $min, 'WITHSCORES');
                $result   = [];
                for($i=0,$num=count($response);$i<$num;$i++) {
                        $result[$response[$i]] = intval($response[++$i]);
                }
                return $result;
        }