Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/islemci/nicemath
A simple math library for your daily math problems
https://github.com/islemci/nicemath
math mathematics npm types
Last synced: 22 days ago
JSON representation
A simple math library for your daily math problems
- Host: GitHub
- URL: https://github.com/islemci/nicemath
- Owner: islemci
- License: mit
- Created: 2024-10-01T16:03:53.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-10-03T16:52:57.000Z (about 1 month ago)
- Last Synced: 2024-10-03T16:55:11.025Z (about 1 month ago)
- Topics: math, mathematics, npm, types
- Language: JavaScript
- Homepage: https://npmjs.com/package/nicemath
- Size: 51.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING
- License: LICENSE
Awesome Lists containing this project
README
# nicemath
[![Tests](https://github.com/islemci/nicemath/actions/workflows/node.js.yml/badge.svg)](https://github.com/islemci/nicemath/actions/workflows/node.js.yml)A simple math library for your daily math problems
## Installation
To install the module, use npm:
```sh
npm install nicemath
```
## Usage```typescript
import * as nice from 'nicemath';// Examples
console.log(nice.add(2, 3)); // 5
console.log(nice.subtract(5, 2)); // 3
console.log(nice.multiply(3, 4)); // 12
console.log(nice.divide(10, 2)); // 5
console.log(nice.power(2, 3)); // 8
console.log(nice.sqrt(9)); // 3
console.log(nice.factorial(5)); // 120
console.log(nice.abs(-5)); // 5
console.log(nice.combination(5, 2)); // 10
console.log(nice.isPrime(7)); // true
// and more...
````## Contributing
Please refer to [CONTRIBUTING](CONTRIBUTING).
## License
This project is licensed under the [MIT License](LICENSE).