You are here

public function Fraction::__construct in Fraction 2.x

Same name and namespace in other branches
  1. 8 src/Fraction.php \Drupal\fraction\Fraction::__construct()

Constructs a Fraction object.

Parameters

string|int $numerator: The fraction's numerator. Defaults to 0.

string|int $denominator: The fraction's denominator. Defaults to 1.

File

src/Fraction.php, line 32

Class

Fraction
A simple class for representing and acting upon a fraction.

Namespace

Drupal\fraction

Code

public function __construct($numerator = 0, $denominator = 1) {
  $this
    ->setNumerator($numerator);
  $this
    ->setDenominator($denominator);
}