I have a custom bundle for mathjs
that looks something like so:
var core = require('mathjs/core');
var math = core.create();
math.import(require('mathjs/lib/type'));
math.import(require('mathjs/lib/function/arithmetic'));
math.import(require('mathjs/lib/function/trigonometry'));
math.import(require('mathjs/lib/expression'));
which I then export. If I then try math.eval('pi')
, I get an Exception:
Exception: Error: Undefined symbol pi
I don't see this error if I import the entire mathjs
library but, then, that rather defeats the purpose of the small custom bundle.
Question: What is the minimal import so that math.eval('pi')
returns 3.14...?