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

comparison of equalities does not work #177

Open Deseux opened 2 months ago

Deseux commented 2 months ago

This code to compare equalities does not work. Answer would be true but it's false.

 import { ComputeEngine } from '@cortex-js/compute-engine';

// Initialisation du Compute Engine
const computeEngine = new ComputeEngine();

// Deux équations à comparer
const eq1 = '3x + 1 = 0';
const eq2 = '6x + 2 = 0';

// Convertir les équations en MathJSON
const mathJson1 = computeEngine.parse(eq1);
const mathJson2 = computeEngine.parse(eq2);

// Comparer les équations
const areEqual = mathJson1.isEqual(mathJson2);

console.log(`Les équations sont ${areEqual ? 'égales' : 'différentes'}`);
Deseux commented 3 weeks ago

@arnog, is this issue will be resolved or I have to find an other solution ? I don't want to rush you, it's just to know if I'm patient or if I need to find another solution.

arnog commented 3 weeks ago

I have a fix in the current repo. I am working on other simplification-related improvements. Ca you wait a few days to get those or do you need a npm release right now?

Deseux commented 3 weeks ago

I can wait, of course...