I don't anderstand why the result is not the same.
f = math.fraction(4,5.1)
console.log(f.toFraction()) --> 2251799813685248/2871044762448691
f = math.fraction(4/5.1)
console.log(f.toFraction()) --> 40/51
Is it possible to add a constructeur of math.fraction(a,b) with a and b decimal ?
f = math.fraction(0)
f.n = 4
f.d = 5.1
console.log(f.toLatex()) // --> \dfrac{4}{5.1}
console.log(f.simplify().toLatex()) // --> \dfrac{40}{51}
console.log(f.toFraction()) // --> 4/5.1
console.log(f.simplify().toFraction()) // --> 40/51
I don't anderstand why the result is not the same.
Is it possible to add a constructeur of math.fraction(a,b) with a and b decimal ?