mathjs
mathjs copied to clipboard
Absolute Value Equations support
syntax example
| −y + 12 | = 1
result
SyntaxError: Value expected (char 1)
expected result
y=11,
y=13
Currently, math.js doesn't have an equation solver – neither for absolute value equations, nor for anything else. But I'm sure we'll get there some day.
Btw, the syntax for absolute value is abs(x), not |x|.
The kernel of this that I can see is a proposal that the parse allow |y+12| as an alternate notation for abs(y+12). That would certainly mesh well with standard mathematical notation. No idea off the top of my head whether it is actually feasible in the parser or not -- could easily imagine things like |x|y|| (intended to be abs(x*abs(y))) being hopelessly confusing to parse because sadly absolute value bars don't have matching open and close versions. Anyhow, retitling the issue to reflect this and moving it to Discussions.