Should math.evaluate("f(x,x)=x")
be an error?
#2815
-
Describe the bug To Reproduce const math = require('mathjs')
const f = math.evaluate("f(x, x) = x")
f(1, 2) I came across this while working on (the rewrite of) my app, math3d.org. See https://www.math3d.org/S9Kp3MDh5 for how this came up. I want user input of But... how should MathJs handle this? Options:
(2) Seems too restrictive. Parsing the expression can be useful for getting structural information. (1) and (3) both seem somewhat reasonable... Curious if this has come up before / is intended behavior. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Thanks for bringing this up. It never occurred to me that you could enter the same variable multiple times, that should indeed throw an error. I've opened an issue to address this bug: #2818 |
Beta Was this translation helpful? Give feedback.
Thanks for bringing this up. It never occurred to me that you could enter the same variable multiple times, that should indeed throw an error. I've opened an issue to address this bug: #2818