Holds the ratio of 2 positive integers in the form of (n:m).
Can be used to define the scale factor in certain situations. The numerator and denominator are not reduced, they are stored as is.
new Ratio(
numerator?,denominator?):Ratio
Throws exception if denominator is 0.
number
Numerator of the ratio.
number
Denominator of the ratio.
0 does not make sense for and should not be passed to either of the parameters.
get denominator():
number
Returns the denominator of the ratio (i.e. m from (n:m)).
number
set denominator(
denominator):void
Sets the denominator of the ratio (i.e. m from (n:m)).
Throws exception if denominator is 0.
0 does not make sense for and should not be supplied to this parameter.
number
Denominator of the ratio.
void
get numerator():
number
Returns the numerator of the ratio (i.e. n from (n:m)).
number
set numerator(
numerator):void
Sets the numerator of the ratio (i.e. n from (n:m)).
0 does not make sense for and should not be supplied to this parameter.
number
Numerator of the ratio.
void
toNumber():
number
Converts the ratio to number.
number