A number type allowing for higher precision when used to represent a rational number with a specified denominator.
new Rational(numerator: number, denominatorType: DenominatorType, doubleValue: number = ...): RationalRepresents a number that can be expressed in the form numerator / denominator. Supports a fixed set of denominator values.
numerator: numberThe numerator of the rational number.denominatorType: DenominatorTypeThe type of the denominator of the rational number.doubleValue: number = ...The closest JavaScript number (if not supplied an approximation is calculated).RationalvalueOf(): numberReturns the doubleValue.
numbertoJSON(): anyConvert to an object that JSON.stringify() can handle.
anytoString(): stringstringreadonly numerator: numberThe numerator of the rational number.
readonly denominatorType: DenominatorTypeThe type of the denominator of the rational number.
readonly doubleValue: number = ...The closest JavaScript number (if not supplied an approximation is calculated).