josdejong/mathjs

UnaryMinus around ConstantNode not mached by "c" in simplify

オープン

#1,406 opened on 2019/02/15

 (3 件のコメント) (0 件のリアクション) (0 人の担当者)JavaScript (1,314 件のフォーク)batch import
featurehelp wanted

Repository metrics

Stars
 (15,065 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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.

コントリビューターガイド