Overview

Namespaces

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

Classes

  • AbstractRationalType
  • GMPRationalType
  • RationalType
  • RationalTypeFactory
  • Overview
  • Namespace
  • Class
  • Tree

Class RationalType

A rational number (i.e a fraction)

chippyash\Type\AbstractType implements chippyash\Type\Interfaces\TypeInterface
Extended by chippyash\Type\AbstractMultiValueType
Extended by chippyash\Type\Number\Rational\AbstractRationalType implements chippyash\Type\Interfaces\RationalTypeInterface, chippyash\Type\Interfaces\NumericTypeInterface
Extended by chippyash\Type\Number\Rational\RationalType
Namespace: chippyash\Type\Number\Rational
Located at Number/Rational/RationalType.php
Methods summary
public
# __construct( chippyash\Type\Number\IntType $num, chippyash\Type\Number\IntType $den, chippyash\Type\BoolType $reduce = null )

Construct new rational Use the RationalTypeFactory to create rationals from native PHP types

Construct new rational Use the RationalTypeFactory to create rationals from native PHP types

Parameters

$num
numerator
$den
denominator
$reduce
-optional: default = true

Overrides

chippyash\Type\AbstractMultiValueType::__construct()
Methods inherited from chippyash\Type\Number\Rational\AbstractRationalType
__toString(), abs(), asComplex(), asFloatType(), asIntType(), asRational(), denominator(), getAsNativeType(), isInteger(), negate(), numerator()
Methods inherited from chippyash\Type\AbstractMultiValueType
__clone(), __invoke(), get(), set()
Chippyash Strong Types API documentation generated by ApiGen 2.8.0