0.22.2 • Published 4 months ago

@abuenameh/compute-engine v0.22.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

MathJSON is a lightweight mathematical notation interchange format based on JSON.

The Cortex Compute Engine can parse LaTeX to MathJSON, serialize MathJSON to LaTeX, format, simplify and evaluate MathJSON expressions.

Reference documentation and guides at cortexjs.io/compute-engine.

npm.io

Using Compute Engine

$ npm install --save @cortex-js/compute-engine
import { parse, evaluate } from "@cortex-js/compute-engine";

const expr = parse("2^{11}-1 \\in \\P");

console.log(expr);
// ➔ ["Element", ["Subtract", ["Power", 2, 11] , 1], "PrimeNumber"]

console.log(evaluate(expr));
// ➔ "False"

More

Related Projects

Support the Project

  • 🌟 Star the GitHub repo (it really helps)
  • 💬 Ask questions and give feedback on our Discussion Forum
  • 📨 Drop a line to arno@arno.org

License

This project is licensed under the MIT License.