math-magic
v1.1.0
Published
Out-of-the-box math utilities.
Downloads
2
Maintainers
Readme
⚠tips: The new version fixed some fatal bugs. Thanks for using😋.
math-magic
Out-of-the-box math utilities.
Getting Started
①. npm install math-magic
②. import {mathMagic} from "math-magic"
Usage
- random()
mathMagic.random()
=> [0, 1)mathMagic.random(3)
=> 0, 1, 2, 3mathMagic.random(3, 4)
=> 3, 4mathMagic.random(0, 2, 2)
=> [0.00, 2.00]
- factorial()
mathMagic.factorial(5)
=> 120
- fibonacci()
mathMagic.fibonacci(6)
=> [0, 1, 1, 2, 3, 5]
- sum()
mathMagic.sum([1, 2, 3, 4, 5,])
=> 15
- average()
mathMagic.average([1, 2, 3, 4, 5], 2)
=> 3.50
License
- MPL-2.0 (Mozilla Public License, version 2.0)