Skip to content

math.simplify reorders operations #933

@AlexxSurin

Description

@AlexxSurin
math.simplify('x + y + a', [{l: 'n+-c', r: 'n-c'}], {a: -1}).toString()

gives

"x - 1 + y"

The order of operations gets changed. Is it an issue?
Is there any way to just simplify signs ('+-n' => '-n', '--n' => 'n') without node tree getting rearranged so drastically (and get x + y - 1 in my example)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions