1.1.0 • Published 5 years ago

math-operations v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Math Operations

Math Operations is a module with lots of mathematical operations.

Installation

npm install math-operations

Importing

const mathOps = require('math-operations');  

Usage

Factorial
Returns the factorial of the number sent as parameter.

mathOps.factorial(5);

Fibonacci
Returns the fibonacci of the number sent as parameter.

mathOps.fibonacci(5);

Sum
Return the sum of the numbers sent as parameters.

mathOps.sum(1, 8, 5, 2);

Bubble Sort
Return the array sent as parameter sorted with bubble sort algorithm.

mathOps.bubbleSort([8, 2, 3, 1]);

Perfect Numbers
Return true case the number sent as parameter is perfect.

mathOps.isPerfect(6);

Prime Numbers
Return true case the number sent as parameter is prime.

mathOps.isPrime(7);

Even or Odd
Two different methods that return a boolean according to the parameter sent.

Returns true case the number sent as parameter is an even number
mathOps.isEven(4);
Returns true case the number sent as parameter is an odd number
mathOps.isOdd(3);
1.1.0

5 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago