Convert an arbitrary decimal number into a simplified fraction (or ratio). See mixed() for instructions on how to break out the whole number part.
mixed()
The decimal number to convert
Maximum absolute error
An object containing the fraction's numerator and denominator
const frac = SMath.rat(0.625); // { num: 5, den: 8 } Copy
const frac = SMath.rat(0.625); // { num: 5, den: 8 }
Convert an arbitrary decimal number into a simplified fraction (or ratio). See
mixed()
for instructions on how to break out the whole number part.