mathe

1.1.8 • Public • Published

This package offers command line tools to

  • do exact calculations with fractions and integers (add, subtract, cancel)
  • solve linear equation systems (Gauss alogrithm)

Usage without Installation

npx -p mathe add 1/2 1/4 // Output: 7/4 = 1 + 3/4 = 1.75

Usage with Installation

npm install -g mathe
add 1/2 1/4 // Output: 7/4 = 1 + 3/4 = 1.75

Further calculation instructions with fractions

subtract 12/4 3/2   // Output: 3/2 = 1 + 1/2 = 1.5
cancel 15/2  // Output: 15/2 = 7 + 1/2 = 7.5
mult -2/3 6/2 // Output: -2/1 = -2 = -2
add 1 2 1/2 2 -1/4   // Output: 21/4 = 5 + 1/4 = 5.25
mult 1/2 1/3 5 1/2 // Output: 5/12 = 0 + 5/12 = 0.4166666666666667
factorize 103839484948498339382828222  // Output: factors of 1.0383948494849834e+26: 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,11,4397,20827745947

Usage examples for solving linear equation systems

Say you have a linear equation system like:
1x + 2y = 4
3x + 5y = 15
This can be solved by typing:

gauss "1,2=4" "3,5=15"  

Output:
solution is:
x0 = 10/1
x1 = 3/-1

Readme

Keywords

none

Package Sidebar

Install

npm i mathe

Weekly Downloads

12

Version

1.1.8

License

MIT

Unpacked Size

17.4 kB

Total Files

20

Last publish

Collaborators

  • flopp1