Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kingzez/easy-math.js
A tiny easy math include addition multiplication subtraction division.
https://github.com/kingzez/easy-math.js
floating-point javascript math math-library mathematics number-converter numeric-computing safe-float true-math typescript typescript-library
Last synced: 23 days ago
JSON representation
A tiny easy math include addition multiplication subtraction division.
- Host: GitHub
- URL: https://github.com/kingzez/easy-math.js
- Owner: kingzez
- Created: 2018-09-25T08:24:02.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-10T03:51:04.000Z (about 4 years ago)
- Last Synced: 2024-09-17T01:39:01.460Z (about 2 months ago)
- Topics: floating-point, javascript, math, math-library, mathematics, number-converter, numeric-computing, safe-float, true-math, typescript, typescript-library
- Language: TypeScript
- Homepage: https://kingzez.github.io/easy-math.js/
- Size: 52.7 KB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Usage
### Add easy-math.js to your project
To install, run:
```console
$ npm i -S easy-math.js
```### Include easy-math.js
You can obtain easy-math.js directly in project with require('easy-math.js')
```js
var emjs = require('easy-math.js')emjs.add(0.1, 0.2) // 0.3
```And you can use ES6 import
```js
import { add } from 'easy-math.js'add(0.1, 0.2) // 0.3
```### Methods
- addition
```js
// 0.1 + 0.2 = 0.30000000000000004
add(0.1, 0.2) // 0.3
```- multiplication
```js
// 0.3 * 0.75 = 0.22499999999999998
multiply(0.3, 0.75) // 0.225
```- subtraction
```js
// 1.5 - 1.2 = 0.30000000000000004
subtract(1.5, 1.2) // 0.3
```- division
```js
// 0.3 / 0.1 = 2.9999999999999996
divide(0.3, 0.1) // 3
```### Test
use avajs test