A number type allowing for higher precision when used to represent a rational number with a specified denominator.
Rational
new Rational(numerator: number, denominatorType: DenominatorType, doubleValue: number = ...): Rational
Represents a number that can be expressed in the form numerator / denominator. Supports a fixed set of denominator values.
numerator: number
The numerator of the rational number.denominatorType: DenominatorType
The type of the denominator of the rational number.doubleValue: number = ...
The closest JavaScript number (if not supplied an approximation is calculated).Rational
fromJSON(json: any): Rational
Rational
valueOf(): number
Returns the doubleValue.
number
toJSON(): any
any
toString(): string
string
readonly numerator: number
readonly denominatorType: DenominatorType
readonly doubleValue: number