-
Hi there, I'm using mathjs to pre-compile (parse) a bunch of expressions. I'm left with a list of
gives both the free-standing symbols but also the builtin maths functions:
I could not find such an API in mathjs, does it exist? Here is equivalent nerdamer function that I need. Otherwise, as workaround, what would be a reliable way to exclude all builtins from the symbol list (ie. where are they stored please)? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
In the parsed expression there is indeed no difference between functions and symbols, nor between functions/symbols defined in mathjs or in your
|
Beta Was this translation helpful? Give feedback.
In the parsed expression there is indeed no difference between functions and symbols, nor between functions/symbols defined in mathjs or in your
scope
. Some tips:sqrt
andasin
from symbols because they are defined as aFunctionNode
having a property.fn
being aSymbolNode
with a.name
property likesqrt
orasin
. You can use the thirdparent
argument ofnode.traverse(function (node, path, parent) {...})
to check that.math.asin
andmath.pi
are defined.inch
ormillimeter
, which will be resolved by mathjs when evaluati…