Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.
This repository was archived by the owner on Feb 6, 2023. It is now read-only.

Inconsistent evaluation of some expressions #12

Description

@zkorz

I am having difficulty with consistency is evaluating expressions.

For example:

var input =  KAS.parse("(3x+7)/(x+4)").expr;
var output = KAS.parse("(-3x-7)/(-x-4)").expr;
input.compare(output)

Should evaluate to true every time, but it only does so 90% of the time.

The following simulation run in any browser will show the problem:

var countTrue = 0; 
var countFalse = 0; 
for(var i = 0; i < 1000; i++) { 
    if(KAS.parse("(3x+7)/(x+4)").expr.compare(KAS.parse("(-3x-7)/(-x-4)").expr)) 
       countTrue++; 
    else 
       countFalse++;
} 
console.log('Count true: '+countTrue); 
console.log('Count false: '+countFalse);

Any help would be greatly appreciated.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions