Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.5x ≠ frac{x}{2} #155

Open
remiangot opened this issue Mar 20, 2024 · 1 comment
Open

0.5x ≠ frac{x}{2} #155

remiangot opened this issue Mar 20, 2024 · 1 comment

Comments

@remiangot
Copy link

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

@truebluepl
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants