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

`simplify()` returns an evaluated value with certain expressions containing `n` #949

Closed
tanman- opened this Issue Sep 28, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@tanman-

tanman- commented Sep 28, 2017

The expression patterns are similar to those in #948 .

Not OK

The n mixed with - seems to be an issue. n is somehow set to 8.

math.simplify('8 - 4n').toString(); // -24
math.simplify('8 - n').toString(); // 0

OK

math.simplify('8 - 4q').toString(); // 8 - 4 * q
math.simplify('8 + 4n').toString(); // 4 * n + 8
math.simplify('8 / 4n').toString(); // 2 * n
math.simplify('8 * 4n').toString(); // 32 * n
math.simplify('8 - 4nq').toString(); // 8 - 4 * nq

Workaround

simplify('8 - 4n', []).toString()

[]: no rules applied.

@josdejong

This comment has been minimized.

Owner

josdejong commented Sep 30, 2017

Thanks for reporting this bug!

@josdejong josdejong added the bug label Sep 30, 2017

@josdejong

This comment has been minimized.

Owner

josdejong commented Sep 30, 2017

When I try math.simplify('8 - 4n1'), using an other internally used symbol n1 instead of n, we get an infinite loop.

This issue probably has the same underlying issue as #948, let's see.

@ericman314

This comment has been minimized.

Collaborator

ericman314 commented Oct 1, 2017

Resolved by #950

@ericman314 ericman314 closed this Oct 1, 2017

@josdejong

This comment has been minimized.

Owner

josdejong commented Oct 1, 2017

This should be fixed now in v3.16.4

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