compute-engine
compute-engine copied to clipboard
0.5x ≠ frac{x}{2}
Description
Problem with decimal and x for isEqual
Steps to Reproduce
import { ComputeEngine } from '@cortex-js/compute-engine'
const engine = new ComputeEngine()
const expr1 = '0.5x'
const expr2 = '\\frac{x}{2}'
const parsedExpr1 = engine.parse(expr1)
const parsedExpr2 = engine.parse(expr2)
console.log(parsedExpr1.isEqual(parsedExpr2)) // false and it should be true
Actual Behavior
parsedExpr1.isEqual(parsedExpr2) return false
There is the same problem with \\frac{1}{2}x or with with the other fractions in decimal notation.
Expected Behavior
parsedExpr1.isEqual(parsedExpr2) return true
Environment
ComputeEngine 0.24.1
Same here. Strange that complicated expressions like in example:
let a = ce.parse('\\frac{3*(x-1)}{(x-1)}');
let b = ce.parse('3');
console.log(a.isEqual(b));
work fine. Is there any hope for a solution this bug?