Set the numerator and denominator.
Optional
numerator: numberOptional
denominator: numberAdd value of another fraction.
Return a new copy with current values.
Divide by value of another Fraction.
Simplify both sides and check if they are equal.
Calculate absolute value.
Multiply by value of another fraction.
Parse a fraction string.
Return the integer component (e.g. 5/2 => 2).
Return the remainder component (e.g. 5/2 => 1).
Set the numerator and denominator.
Simplify numerator and denominator using GCD.
Subtract value of another fraction.
Return string representation in mixed form.
Return a simplified string representation.
Return a raw string representation (e.g. "5/2").
Return the value of the fraction.
Static
GCDGCD: Greatest common divisor using the Euclidean algorithm. Note: GCD(0, 0) => 0 and GCD(0, n) => n.
Static
LCMLCM: Lowest common multiple.
Static
LCMMLowest common multiple for more than two numbers.
Note that the args
array will be manipulated and shortened recursively during
computation.
Fraction represents a rational number.