public function Fraction::setNumerator in Fraction 7
Set the numerator.
Parameters
$value: The numerator value.
Return value
Fraction Returns this Fraction object.
9 calls to Fraction::setNumerator()
- Fraction::add in ./
fraction.class.inc - Add another fraction to this one.
- Fraction::divide in ./
fraction.class.inc - Divide this fraction by another one.
- Fraction::fromDecimal in ./
fraction.class.inc - Calculates the numerator and denominator from a decimal value.
- Fraction::multiply in ./
fraction.class.inc - Multiply this fraction with another one.
- Fraction::reciprocate in ./
fraction.class.inc - Reciprocate the fraction.
File
- ./
fraction.class.inc, line 40 - Fraction class
Class
- Fraction
- @file Fraction class
Code
public function setNumerator($value) {
// Cast the value as a string and save it.
$this->numerator = (string) $value;
return $this;
}