1.1.0 • Published 2 years ago

math-magic v1.1.0

Weekly downloads
-
License
MPL-2.0
Repository
github
Last release
2 years ago

npm install size license chat downloads

⚠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

  1. random()
  • mathMagic.random() => [0, 1)
  • mathMagic.random(3) => 0, 1, 2, 3
  • mathMagic.random(3, 4) => 3, 4
  • mathMagic.random(0, 2, 2) => 0.00, 2.00
  1. factorial()
  • mathMagic.factorial(5) => 120
  1. fibonacci()
  1. sum()
  • mathMagic.sum([1, 2, 3, 4, 5,]) => 15
  1. average()
  • mathMagic.average([1, 2, 3, 4, 5], 2) => 3.50

License

  • MPL-2.0 (Mozilla Public License, version 2.0)