cortex-js / compute-engine

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

expr = ce.parse("\frac{x^{n}}{a}") evaluate to constant when changing x #158

Closed erramidad123 closed 4 months ago

erramidad123 commented 5 months ago

a : integer > 1 : [2,4,5,6,7,8....] n : integer > 1

exp : const expr = ce.parse("\frac{x}{3}");

for (const x = 0; x < 1; x += 0.01) { ce.assign('x', x); console.log(f(${x}) = ${expr.value}); // this will be constant all time . }

arnog commented 4 months ago

It seems to work using top of tree. I believe this is a duplicate of #150.