You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 23, 2019. It is now read-only.
I'm using algebra.js probably not as intended; I'm using it to actually solve some equations within my application. But it's super helpful, so I'd like to make it work. It appears that numbers with a lot of precision don't remain integers somewhere along the way. The following code:
algebra
.parse('((23/25C + 297176318895199/312500000000000)*(0.5))-50-((23/25C + 297176318895199/312500000000000)*(0.09))')
.eval({C: new Fraction(29114907, 5000)})
Gives me an error:
Uncaught TypeError: Invalid Argument (52412560532480240,24414062500000.004): Divisor and dividend must be of type Integer.
at new Fraction (node_modules/algebra.js/src/fractions.js:12:15)
at Fraction.copy (node_modules/algebra.js/src/fractions.js:17:12)
at Fraction.reduce (node_modules/algebra.js/src/fractions.js:21:21)
at Fraction.add (node_modules/algebra.js/src/fractions.js:77:29)
at node_modules/algebra.js/src/expressions.js:28:57
at Array.reduce (<anonymous>)
at Expression.constant (node_modules/algebra.js/src/expressions.js:28:27)
at Expression.simplify (node_modules/algebra.js/src/expressions.js:41:28)
at Expression.add (node_modules/algebra.js/src/expressions.js:73:59)
at node_modules/algebra.js/src/expressions.js:187:52
The text was updated successfully, but these errors were encountered:
I'm using algebra.js probably not as intended; I'm using it to actually solve some equations within my application. But it's super helpful, so I'd like to make it work. It appears that numbers with a lot of precision don't remain integers somewhere along the way. The following code:
Gives me an error:
The text was updated successfully, but these errors were encountered: