DailyJS

MathExt

Alex R. Young

Subscribe

@dailyjs

Facebook

Google+

libraries mathematics

MathExt

Posted by Alex R. Young on .
Featured

libraries mathematics

MathExt

Posted by Alex R. Young on .

MathExt is a JavaScript library for parsing mathematical formulas by Lars Knickrehm. It has a
very advanced and flexible API, allowing configuration over accuracy,
separators, and the radix character. It supports things like hyperbolic
functions, trigonometric functions, and has translations for English and
German.

Loading the required files and performing a calculation looks like this:

    var oMathExt = MathExt.Load();
    oMathExt.Calculate('cos(8) * π');

It's clever enough to get the precedence correct:

oMathExt.Calculate('cos 8 * π');

The scientific-calculator interface shown above can be found in the
project's documentation. It uses
explorercanvas, which means it works in IE too.