Miss any of our Open RFC calls?Watch the recordings here! »

arithmetic

1.0.1 • Public • Published

arithmetic

Build Status Code Climate Version Downloads

Arithmetic safely conducts arithmetic operations by ensuring the values are valid numbers and typecasting them prior to evaluation.

Install

$ npm install --save arithmetic

Usage

var arithmetic = require('arithmetic')
 
arithmetic.add(4, 2)
// => 6

API

arithmetic.add(num1, num2) -> number

num1/num2

Required
Type: number

arithmetic.sum(numbers) -> number

numbers

Required
Type: number array

arithmetic.subtract(num1, num2) -> number

num1/num2

Required
Type: number

arithmetic.difference(numbers) -> number

numbers

Required
Type: number array

arithmetic.multiply(num1, num2) -> number

num1/num2

Required
Type: number

arithmetic.product(numbers) -> number

numbers

Required
Type: number array

arithmetic.divide(num1, num2) -> number

num1/num2

Required
Type: number

arithmetic.quotient(numbers) -> number

numbers

Required
Type: number array

Install

npm i arithmetic

DownloadsWeekly Downloads

16

Version

1.0.1

License

MIT

Last publish

Collaborators

  • avatar