cortex-js / compute-engine

An engine for symbolic manipulation and numeric evaluation of math formulas expressed with MathJSON
https://cortexjs.io
MIT License
370 stars 45 forks source link

Fractions with big powers return wrong result #162

Closed truebluepl closed 5 months ago

truebluepl commented 5 months ago

Description

Fraction \frac{27^{12}}{9^{19}} returns wrong value.

Actual Behavior

Fraction value is 0.11111111111111113 as value compiled to JavaScript. Should be 0.11111111111111111 (which is 1/9).

If I try check equality via isEqual between 1/9 and \frac{27^{12}}{9^{19}} I get error: compute-engine.min.js:51 Error: [DecimalError] Invalid argument: 7504731764849957,67542585883649600

Expected Behavior

Value compiled to JS should be proper or there should be availability to check equality.