Indicates whether a given Number is a Prime Number.
@access		public
@static
@param		int			$number		Number to be checked
@return		bool
972082
public static function isPrime( $number )
	{
		Deprecation::getInstance()
			->setErrorVersion( '0.8.5' )
			->setExceptionVersion( '0.9' )
			->message( sprintf(
				'Please use %s (%s) instead',
				'public library "CeusMedia/Math"',
			 	'https://packagist.org/packages/ceus-media/math'
			) );
		if( $number < 2 )
			return false;
		$edge = floor( sqrt( $number ) );
		for( $i=2; $i<=$edge; $i++ )
			if( $number % $i == 0 )
				return false;
		return true;
	}
451288
public function number($number)
    {
        if ($number < 0) {
            $number   = -$number;
            $negative = self::NEGATIVE;
        } else {
            $negative = '';
        }
        $parts    = explode(self::DECIMAL, (string) $number, 2);
        $integers = $parts[0];
        if (strlen($integers) >= $this->digitsFirstGroup() + $this->minimumGroupingDigits()) {
            $todo     = substr($integers, 0, -$this->digitsFirstGroup());
            $integers = self::GROUP . substr($integers, -$this->digitsFirstGroup());
            while (strlen($todo) >= $this->digitsGroup() + $this->minimumGroupingDigits()) {
                $integers = self::GROUP . substr($todo, -$this->digitsGroup()) . $integers;
                $todo     = substr($todo, 0, -$this->digitsGroup());
            }
            $integers = $todo . $integers;
        }
        if (count($parts) > 1) {
            $decimals = self::DECIMAL . $parts[1];
        } else {
            $decimals = '';
        }

        return $this->digits($negative . $integers . $decimals);
    }
912384
private function isValidResult($number, $min, $max)
    {
        return is_int($number) && $number >= $min && $number <= $max;
    }
444836
public function getNumber($number)
    {
        switch ($this->_type) {
            case self::TYPE_ALPHA_UPPER:
                return $this->getAlphaNumber($number);
            case self::TYPE_ALPHA_LOWER:
                return $this->getAlphaNumber($number, true);
            case self::TYPE_ROMAN_UPPER:
                return $this->getRomanNumber($number);
            case self::TYPE_ROMAN_LOWER:
                return $this->getRomanNumber($number, true);
            // default is alpha
            default:
                return $number;
        }
    }
1368232
public function isInteger()
    {
        return $this->data_type === PDO::PARAM_INT ||
            $this->data_type === (PDO::PARAM_INT | PDO::PARAM_INPUT_OUTPUT);
    }
1263368
public static function isQtiInteger($integer)
    {
        // QTI integers are twos-complement 32-bits integers.
        if (is_int($integer) === false) {
            return false;
        } elseif ($integer > 2147483647) {
            return false;
        } elseif ($integer < -2147483647) {
            return false;
        } else {
            return true;
        }
    }
791656
public boolean hasSameNumberAs(Number number) {
        checkNumber(number);
        try {
            return this.number == getInternalNumber(number, false);
        } catch (ArithmeticException e) {
            return false;
        }
    }
520848
public function offset(int $number)
    {
        $instance = $this->offsetStrategyInstance();

        $instance->offsetStrategy()->offset($number);

        return $instance;
    }
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;
    }
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 );
	}
431910
public static function toInteger($input = false) {

        if ($input && Validate::isNumber($input)) {

            $integer = (int) $input;
            if (Validate::isInteger($integer)) {

                return $integer;
            }
        }

        return false;
    }
416548
public static function isInteger($value)
    {
        if (!is_scalar($value) || is_float($value)) {
            return false;
        }
        if (is_int($value)) {
            return true;
        }

        return (bool)preg_match('/^-?[0-9]+$/', $value);
    }
1015267
public static function floor($number)
    {
        if (self::compare($number, 0) == 1) {
            $result = bcadd($number, '0', 0);
        } else {
            $result = bcadd($number, '-1', 0);
        }

        return $result;
    }
552208
public function gt($number)
    {
        return (bool) (bccomp($this->number, static::validateInputNumber($number), $this->precision) === 1);
    }
382009
public static boolean isPrimes(int n) {
		Assert.isTrue(n > 1, "The number must be > 1");
		for (int i = 2; i <= Math.sqrt(n); i++) {
			if (n % i == 0) {
				return false;
			}
		}
		return true;
	}
1039231
public function lengthGreaterThan($number)
    {
        //argument 1 must be numeric
        Argument::i()->test(1, 'numeric');
        
        return strlen((string)$this->value) > (float)$number;
    }
1248638
public function eq($number)
    {
        return (bool) (bccomp($this->number, static::validateInputNumber($number), $this->precision) === 0);
    }