Overview

Namespaces

  • chippyash
    • Type
      • Exceptions
      • Interfaces
      • Number
        • Complex
        • Rational
      • String

Classes

  • FloatType
  • GMPIntType
  • IntType
  • NaturalIntType
  • WholeIntType
  • Overview
  • Namespace
  • Class
  • Tree

Class IntType

Integer Type

chippyash\Type\AbstractType implements chippyash\Type\Interfaces\TypeInterface
Extended by chippyash\Type\Number\IntType implements chippyash\Type\Interfaces\NumericTypeInterface

Direct known subclasses

chippyash\Type\Number\GMPIntType, chippyash\Type\Number\NaturalIntType, chippyash\Type\Number\WholeIntType
Namespace: chippyash\Type\Number
Located at Number/IntType.php
Methods summary
public chippyash\Type\Number\IntType
# negate( )

Negates the number

Negates the number

Returns

chippyash\Type\Number\IntType
Fluent Interface

Implementation of

chippyash\Type\Interfaces\NumericTypeInterface::negate()
public chippyash\Type\Number\Complex\ComplexType
# asComplex( )

Return the number as a Complex number i.e. n+0i

Return the number as a Complex number i.e. n+0i

Returns

chippyash\Type\Number\Complex\ComplexType
\chippyash\Type\Number\Complex\ComplexType

Implementation of

chippyash\Type\Interfaces\NumericTypeInterface::asComplex()
public chippyash\Type\Number\Rational\RationalType
# asRational( )

Return number as Rational number. NB, numerator and denominator will be caste as IntTypes

Return number as Rational number. NB, numerator and denominator will be caste as IntTypes

Returns

chippyash\Type\Number\Rational\RationalType
\chippyash\Type\Number\Rational\RationalType

Implementation of

chippyash\Type\Interfaces\NumericTypeInterface::asRational()
public chippyash\Type\Number\IntType
# asIntType( )

Return number as an IntType number.

Return number as an IntType number.

Returns

chippyash\Type\Number\IntType
\chippyash\Type\Number\IntType

Implementation of

chippyash\Type\Interfaces\NumericTypeInterface::asIntType()
public chippyash\Type\Number\FloatType
# asFloatType( )

Return number as a FloatType number.

Return number as a FloatType number.

Returns

chippyash\Type\Number\FloatType
\chippyash\Type\Number\FloatType

Implementation of

chippyash\Type\Interfaces\NumericTypeInterface::asFloatType()
public chippyash\Type\Number\IntType
# abs( )

Return the absolute value of the number

Return the absolute value of the number

Returns

chippyash\Type\Number\IntType
\chippyash\Type\Number\IntType

Implementation of

chippyash\Type\Interfaces\NumericTypeInterface::abs()
public array
# factors( )

Return all factors of this number (sorted)

Return all factors of this number (sorted)

Returns

array
[factor,factor, ...]
public array
# primeFactors( )

Return all prime factors of this number

Return all prime factors of this number

Adapted from

Returns

array
[primeFactor => exponent,...]

Link

http://www.thatsgeeky.com/2011/03/prime-factoring-with-php/
Methods inherited from chippyash\Type\AbstractType
__construct(), __invoke(), __toString(), get(), set()
Chippyash Strong Types API documentation generated by ApiGen 2.8.0