numcal

4.0.0 • Public • Published

numcal

Build Status Code Climate Code Coverage npm Version JS Standard

Basic numeric calculation functions.

Installation

npm install numcal --save

Usage

'use strict'
 
const numcal = require('numcal')
 
//------------------------
// min
//------------------------
console.log(numcal.min(3, 2, 4)) //-> 2
console.log(numcal.min([3, 2, 4])) //-> 2
 
//------------------------
// max
//------------------------
console.log(numcal.max(3, 2, 4)) //-> 4
console.log(numcal.max([3, 2, 4])) //-> 4
 
//------------------------
// sum
//------------------------
console.log(numcal.sum(3, 2, 4)) //-> 9
console.log(numcal.sum([3, 2, 4])) //-> 9
 
//------------------------
// ave
//------------------------
console.log(numcal.ave(3, 2, 4)) //-> 3
console.log(numcal.ave([3, 2, 4])) //-> 3
 
 

API

Signature Description
.min(val1, val2...) Get minimum value.
.min([val1, val2...]) Get minimum value in array.
.max(val1, val2...) Get maximum value.
.max([val1, val2...]) Get maximum value in array.
.sum(val1, val2...) Get sum value.
.sum([val1, val2...]) Get sum value for array.
.ave(val1, val2...) Get average value.
.ave([val1, val2...]) Get average value for array.

License

This software is released under the MIT License.

Links

Readme

Keywords

none

Package Sidebar

Install

npm i numcal

Weekly Downloads

34

Version

4.0.0

License

MIT

Unpacked Size

28.2 kB

Total Files

34

Last publish

Collaborators

  • okunishinishi