Gets a rule that requires numbers to be in a given range.

@param int|float $min The minimum value, inclusive
@param int|float $max The maximum value, inclusive
@return \Caridea\Validate\Rule\Compare the created rule
970070
public static function between($min, $max): Compare
    {
        $value = $min > $max ? [$max, $min] : [$min, $max];
        return new Compare('bt', $value);
    }
1251880
public static function random($min, $max = null)
    {
        if (String::isEmpty($max) ||
            $max > getrandmax()) {
            $max = getrandmax();
        }

        return rand($min, $max);
    }
191597
protected function lengthValidate($value, $min, $max)
    {
        return $min <= mb_strlen($value) && mb_strlen($value) <= $max;
    }
1199306
function range($min = null, $max = null)
	{
		$this->min($min);
		$this->max($max);
		return $this;
	}
1215465
public function getRand($min = 0, $max = 0x7fffffff)
    {
        $t = ($this->x ^ ($this->x << 11)) & 0x7fffffff;
        $this->x = $this->y;
        $this->y = $this->z;
        $this->z = $this->w;
        $this->w = ( $this->w ^ ($this->w >> 19) ^ ( $t ^ ( $t >> 8 )) );
        return $this->w % ($max - $min + 1) + $min;
    }
560616
protected function random(float $min, float $max) : float
    {
        return ($min + lcg_value() * (abs($max - $min)));
    }
1284050
public function vBetween(Int $min = 0, Int $max = 0)
    {
        return $this->setJavascriptValidation
        (
            'ZNValidationBetween', 
            ['betweenBoth' => [':p1' => $min, ':p2' => $max]],
            ['betweenBoth' => [$min, $max]],
            [$min, $max]  
        );
    }
611962
public function length($min, $max) {
        $this->check_role = 'length';
        $this->rule = "$min,$max";
        if (is_array($this->value)) {
            $length = count($this->value);
        } elseif ($this->value instanceof File) {
            $length = filesize($this->value->path_tmp);
        } else {
            $length = mb_strlen((string)$this->value);
        }
        $result = $length < $min || $length > $max;
        $this->checkResult($result);
        return $this;
    }
560090
public function setMin($min)
    {
        if (null !== $this->_max && $min > $this->_max) {
            /**
             * @see Zend_Validate_Exception
             */
            include_once 'Zend/Validate/Exception.php';
            throw new Zend_Validate_Exception(
                "The minimum must be less than or equal to the maximum length, but $min >"
                . " $this->_max"
            );
        }
        $this->_min = max(0, (integer) $min);
        return $this;
    }
496179
public static function isOptionalIntegerRange($value, $min, $max)
    {
        /* No additional validations when the value is null. */
        if (null === $value) {

            return true;
        }

        return self::isRequiredIntegerRange($value, $min, $max);
    }
215855
public function deleteByRank(int $min, int $max): int
    {
        return $this->handle->zRemRangeByRank($this->name, $min , $max );
    }
867297
public static function int($min, $max)
    {
        $int = self::php7Int($min, $max);
        if (! isset($int)) {
            $int = self::bytesToInt($min, $max);
        }
        return $int;
    }
41810
public function rule_between( $key, $value, $min, $max )
	{
		return $this->rule_between_num( $key, strlen( $value ), $min, $max );
	}
371804
public function min(float $min, string $error = 'not at least %d') : Real
    {
        return $this->pipe(
            self::predicate(
                function (float $value) use ($min) : bool {
                    return $value >= $min;
                },
                sprintf($error, $min)
            )
        );
    }
908840
public static Validation<Integer> range(int min, int max) {
        return greaterThan(min).and(lowerThan(max));
    }
18093
public function _validation_numeric_between($val, $min_val, $max_val)
	{
		return $this->_empty($val) or (floatval($val) >= floatval($min_val) and floatval($val) <= floatval($max_val));
	}
640627
public function whereBetween($field, $min, $max)
    {
        foreach ($this->queries as $query) {
            $query->whereBetween($field, $min, $max);
        }

        return $this;
    }