GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - mathflowjs/mathflow: 🟦 A lightweight JavaScript library for evaluating mathematical expressions written in natural mathematical notation.

BranchesTags
Open more actions menu

Latest commit

 

History

135 Commits
135 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.husky
.husky
 
 
demo
demo
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.prettierrc
.prettierrc
 
 
.release-it.json
.release-it.json
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CLAUDE.md
CLAUDE.md
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
TODO.md
TODO.md
 
 
build.config.ts
build.config.ts
 
 
eslint.config.js
eslint.config.js
 
 
index.html
index.html
 
 
package.json
package.json
 
 
pnpm-lock.yaml
pnpm-lock.yaml
 
 
pnpm-workspace.yaml
pnpm-workspace.yaml
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

Mathflow

Simplifying Math, Empowering Code.

Overview

Mathflow is a lightweight JavaScript library for evaluating mathematical expressions written in natural mathematical notation. It parses and computes standard arithmetic, trignometric functions, logarithms, and algebraic expressions exactly as you would write them on paper.

Features

  • Natural syntax: Write 2x + 3(y - 1) instead of 2*x + 3*(y - 1). Both are supported anyway.
  • Step-by-step solutions: Every result comes with the working out, one line per step.
  • Mathematical functions: Over a hundred built-ins - trigonometry, logarithms, statistics, combinatorics, special functions and more.
  • Variables: Assign and use variables like x = 5, y = 5x - 1
  • Clean & modern syntax: Readable and easy-to-write syntax for mathematical expressions.
  • AST-based parsing: Proper order of operations and expression evaluation.
  • Lightweight: Focused purely on mathematical computation without bloat.
import { createContext } from '@mathflowjs/mathflow';

const ctx = createContext({ preferences: { angles: 'deg' } });

ctx.solve('x = 5');
ctx.solve('2x^3 + sqrt(25)');
// {
//   value: 255,
//   solution: [
//     '2 * 5 ^ 3 + sqrt(25)',
//     '2 * 125 + 5',
//     '250 + 5',
//     '255'
//   ]
// }

Every value is a plain number, so a data set is written variadically: mean(1, 2, 3), not mean([1, 2, 3]). See TODO.md for the full function list and for what is deliberately out of scope.

Use Cases

  • Formula calculators and mathematical tools.
  • Educational applications for learning mathematics.
  • Basic scientific computing interfaces.
  • Anywhere you need to evaluate user-input mathematical expressions safely.

Documentation

To get started with Mathflow, read the documentation here.

Contributing

Contributions are welcome to make Mathflow even better! Feel free to open issues or submit pull requests.

License

This project is licensed under the MIT License

Copyright © 2024-present, Henry Hale

About

🟦 A lightweight JavaScript library for evaluating mathematical expressions written in natural mathematical notation.

mathflow.js.org/

Topics

henryhalelanguagemath-expression-evaluatormath-expression-solvermath-librarymath-parsermathematical-expressionsmathematicststypescript

Resources

Readme
MIT license
Activity
Custom properties

Stars

3 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.