Converts a decimal to a fraction which is represented as an array of its numerator and denominator.
// Returns [-5, 4]const fraction = Chalkboard.numb.toFraction(-1.25); Copy
// Returns [-5, 4]const fraction = Chalkboard.numb.toFraction(-1.25);
The decimal
Optional
The tolerance of the approximation algorithm (optional, defaults to 1e-8)
Converts a decimal to a fraction which is represented as an array of its numerator and denominator.
Example