JSPM

arithmetic

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 10
  • Score
    100M100P100Q50520F
  • License MIT

Simple javascript safe arithmetic functions

Package Exports

  • arithmetic

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (arithmetic) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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