josdejong / josdejong/mathjs

UnaryMinus around ConstantNode not mached by "c" in simplify

Open
#1,406 3 comments 0 reactions 0 assignees View on GitHub
feature help wanted
Dominant language
JavaScript
Stars
15.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

A unaryMinus wrapped around a ConstantNode is matched by "v", not "c", in the simplify function. While this matches the documentation, it is not what is expected for a "constant" and a "non-constant". Other single variable functions with a constant node are simplified to their result, and thus can be matched with "c". If existing compatibility presents an issue, this could be enabled as an option of the simplify function that defaults to the old behavior or by adding two new simplification selectors.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.