Determines if the exponent fits into this size of float.

@param $exponent int The exponent to check.
@return bool True if it fits, false otherwise.
974954
public static function exponentFits($exponent)
    {
        // Determine if the exponent fits
        $max = floor((pow(2, static::getNumExponentBits()) - 1) / 2);
        $min = (-1 * $max) + 1;

        return (($exponent >= $min) && ($exponent <= $max));
    }
701471
public static function countDecimals(float $value)
    {
        // When the value when cast to an integer is about the same, return 0 decimal places. Otherwise count them.
        return (int) $value == $value ? 0 : (strlen($value) - strrpos($value, '.') - 1);
    }
752005
public function gte($number)
    {
        return (bool) (bccomp($this->number, static::validateInputNumber($number), $this->precision) >= 0);
    }
393592
private function isUnixTimestamp($value): bool
    {
        return
            (string)(float)$value == (string)$value &&
            ((float)$value <= PHP_INT_MAX) &&
            ((float)$value >= ~PHP_INT_MAX)
            ;
    }
651176
public function hasSuffix(string $suffix):bool {
        if (0 !== $this->getLength() && "" === $suffix) return false;
        return (substr($this->getValue(), -1 * strlen($suffix), strlen($suffix)) === $suffix);
    }
539068
public function resize_fit($width, $height) {
        if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height)))
            return true;
        if (!$width || (($height / $width) < ($this->height / $this->width)))
            $width = intval(($this->width * $height) / $this->height);
        elseif (!$height || (($width / $height) < ($this->width / $this->height)))
            $height = intval(($this->height * $width) / $this->width);
        if (!$width) $width = 1;
        if (!$height) $height = 1;
        return $this->resize($width, $height);
    }
879142
public function getIsDecimalEven( $precision = false )
	{
		if ( ! $this->getIsDecimal() ) {
			return false;
		}

		if ( $precision === false ) $precision = $this->scale( $this->_value );
		if ( $precision < 0 ) $precision = $precision = 0;

		$decimalPart = $this->getDecimalPart();
		if ( $precision >= strlen( $decimalPart ) ) return false;

		// Get the portion of the decimal part affected by the scale value
		$decimalPart = substr( $decimalPart, $precision );
		return $decimalPart[0] % 2 === 0;
	}
783616
private function containsAtLeastOneUpperCaseCharacter(string $password): bool
    {
        if ($this->constraints['requireAtLeastOneUpperCaseCharacter']) {
            return (bool)preg_match(self::AT_LEAST_ONE_UPPER_CASE_CHARACTER_REGEX, $password);
        }

        return true;
    }
1033767
public static function validate($rating)
    {
        if (\is_numeric($rating) && $rating > -0.01 && $rating < 5.01) {
            \preg_match('/([0-9].[0-9])/', $rating, $matches);
            $matches[0] = \floatval($matches[0]);

            return (!empty($matches[0]) && $matches[0] <= 5.0 && $matches[0] >= 0.0) ? $matches[0] : false;
        }

        return false;
    }
518367
protected function isPrimeNumber($number)
    {
        $number = \abs($number);

        // 2 is an exception.
        if (2 === $number) {
            return true;
        }

        // Check if number is even.
        if (!($number & 1)) {
            return false;
        }

        $sqrtNumber = \sqrt($number);
        for ($divisor = 3; $divisor <= $sqrtNumber; $divisor += 2) {
            if (0 === $number % $divisor) {
                return false;
            }
        }

        return true;
    }
221690
public static function assertIsFloat($variable, Throwable $exception): bool
    {
        static::makeAssertion(\is_float($variable), $exception);
        return true;
    }
556642
public static function isFloat($value)
    {
        if (is_float($value)) {
            return true;
        } elseif (!is_string($value)) {
            return false;
        }

        return preg_match('/^[0-9]+\.[0-9]+$/', $value) > 0;
    }
705925
public function Compare( $number, $scale = false )
	{
		if ( ! is_numeric( $number ) )
		{
			if ( ! $number instanceof DecimalValue && ! $number instanceof Integer )
			{
				return false;
			}

			$number = $number->getValue();
		}

		if ( $scale === false )
		{
			$scale = max( $this->getScale(), $this->scale( $number ) );
		}

		return bccomp( $this->_value, $number, $scale );
	}
825411
private function isInteger($float, $allowIntegers)
    {
        if (!$allowIntegers || round($float) !== $float) {
            return false;
        } elseif (abs($float) < self::FLOAT_MAX) {
            return true;
        }

        return $allowIntegers === 'all';
    }
513025
private static function boolval($value)
    {
        if (is_numeric($value)) {
            $value = (float) $value > 0;
        } elseif (is_string($value)) {
            $value = 'false' !== $value;
        }

        return is_bool($value) ? $value : false;
    }
1077424
protected function isLarge($value)
    {
        $size = $this->getSize();
        if (!$size) {
            return false;
        }
        return strlen($value) > $size;
    }
1154132
protected function _validate_float($value)
    {
        if (is_int($value) || is_float($value)) {
            return $value;
        }

        if (filter_var($value, FILTER_VALIDATE_FLOAT) !== false
            && preg_match('#^[+-]?[\d\.]+$#', $value) === 1
        ) {
            return (float)$value;
        } else {
            return null;
        }
    }