ml-math

1.4.5 • Public • Published

ml-math

Hi! I developed this small module for myself for fun. It focuses on mathematical operations and number manipulation.

Module

This module is divided into

  • numbers

    • isNumeric
    • isOdd
    • isEven
    • isPrime
  • calculator

    • add
    • addArray
    • subtract
    • subtractArray
    • multiply
    • multiplyArray
    • divide
    • divideArray

Usage

import via

npm i ml-math

or

yarn add ml-math

require

const {numbers, calculator} = require('ml-math');

and use it

let val = 10;
if (numbers.isNumeric(val) && numbers.isEven(val)) {
	val = calculator.add(val, 3); // 13
}
console.log(calculator.multiply(val, 10)); // 130
const array = [1, 2, 3, 4, 5];
console.log(calculator.multiplyArray(array)); // 120

Readme

Keywords

none

Package Sidebar

Install

npm i ml-math

Weekly Downloads

1

Version

1.4.5

License

ISC

Unpacked Size

108 kB

Total Files

18

Last publish

Collaborators

  • michiqt