Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

math-helper-functions

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

math-helper-functions

Helper with misc. math functions such as sums, averages, max, min, etc

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
149
decreased by-62.75%
Maintainers
1
Weekly downloads
 
Created
Source

MathFunctions

Kind: global class

new MathFunctions()

MathFunctions class Compendium of math-related functions

MathFunctions.calcMax(array, [property]) ⇒ Number

Returns array max value

Kind: static method of MathFunctions Returns: Number - Max array value

ParamTypeDefaultDescription
arrayArrayArray to find max value of
[property]stringnullProperty name to iterate

MathFunctions.calcSum(array, [property]) ⇒ Number

Returns the sum of an array

Kind: static method of MathFunctions Returns: Number - Sum of array values

ParamTypeDefaultDescription
arrayArrayArray to find sum of
[property]stringnullProperty name to iterate

MathFunctions.calcMin(array, [property]) ⇒ Number

Returns min value in array

Kind: static method of MathFunctions Returns: Number - Min array value

ParamTypeDefaultDescription
arrayArrayArray to find min value of
[property]stringnullProperty name to iterate

MathFunctions.calcDomain(array, [property]) ⇒ Array.<number>

Returns min and max values in array

Kind: static method of MathFunctions Returns: Array.<number> - Min and max values in array

ParamTypeDefaultDescription
arrayArray.<string> | Array.<number>Array to calc domain of
[property]stringnullProperty name to iterate

MathFunctions.calcMedian(array, [property]) ⇒ number

Returns median value of array

Kind: static method of MathFunctions Returns: number - Median of an array

ParamTypeDefaultDescription
arrayArrayArray to find median of
[property]stringnullProperty name to iterate

MathFunctions.calcMean(array, [property]) ⇒ Number

Returns mean value in array

Kind: static method of MathFunctions Returns: Number - Mean of an array

ParamTypeDefaultDescription
arrayArrayArray to find mean of
[property]stringnullProperty name to iterate

MathFunctions.calcPercent(toCalc, total) ⇒ Number

Calculate percentage using rule of three

Kind: static method of MathFunctions Returns: Number - Percentage

ParamTypeDescription
toCalcNumberNumber to find percent of
totalNumberTotal

MathFunctions.calcDistribution(array, [numOfBins]) ⇒ object

Gets array distribution

Kind: static method of MathFunctions Returns: object - Distribution of the array's values

ParamTypeDescription
arrayArray.<number> | Array.<string>Array to find distribution of
[numOfBins]numberNumber of bins to use (optional)

Keywords

FAQs

Package last updated on 18 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc