Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
math-helper-functions
Advanced tools
Helper with misc. math functions such as sums, averages, max, min, etc
Kind: global class
Number
Number
Number
Array.<number>
number
Number
Number
object
Array.<number>
Array.<number>
number
MathFunctions class Compendium of math-related functions
Number
Returns array max value
Kind: static method of MathFunctions
Returns: Number
- Max array value
Param | Type | Default | Description |
---|---|---|---|
array | Array | Array to find max value of | |
[property] | string | null | Property name to iterate |
Number
Returns the sum of an array
Kind: static method of MathFunctions
Returns: Number
- Sum of array values
Param | Type | Default | Description |
---|---|---|---|
array | Array | Array to find sum of | |
[property] | string | null | Property name to iterate |
Number
Returns min value in array
Kind: static method of MathFunctions
Returns: Number
- Min array value
Param | Type | Default | Description |
---|---|---|---|
array | Array | Array to find min value of | |
[property] | string | null | Property name to iterate |
Array.<number>
Returns min and max values in array
Kind: static method of MathFunctions
Returns: Array.<number>
- Min and max values in array
Param | Type | Default | Description |
---|---|---|---|
array | Array.<string> | Array.<number> | Array to calc domain of | |
[property] | string | null | Property name to iterate |
number
Returns median value of array
Kind: static method of MathFunctions
Returns: number
- Median of an array
Param | Type | Default | Description |
---|---|---|---|
array | Array | Array to find median of | |
[property] | string | null | Property name to iterate |
Number
Returns mean value in array
Kind: static method of MathFunctions
Returns: Number
- Mean of an array
Param | Type | Default | Description |
---|---|---|---|
array | Array | Array to find mean of | |
[property] | string | null | Property name to iterate |
Number
Calculate percentage using rule of three
Kind: static method of MathFunctions
Returns: Number
- Percentage
Param | Type | Description |
---|---|---|
toCalc | Number | Number to find percent of |
total | Number | Total |
object
Gets array distribution
Kind: static method of MathFunctions
Returns: object
- Distribution of the array's values
Param | Type | Description |
---|---|---|
array | Array.<number> | Array.<string> | Array to find distribution of |
[numOfBins] | number | Number of bins to use (optional) |
Array.<number>
Calcs quartiles of data array
Kind: static method of MathFunctions
Returns: Array.<number>
- [min, mean, max] quartiles
Param | Type | Description |
---|---|---|
array | Array.<any> | Array to find quartiles of |
[property] | string | Property to access in object arrays. Supports nested properties (ex: 'propA.propB') |
Array.<number>
Calcs histogram from data array
Kind: static method of MathFunctions
Returns: Array.<number>
- Distribution data array
Param | Type | Default | Description |
---|---|---|---|
array | Array.<any> | Array to get histogram from | |
[numberOfBins] | number | 4 | Number of bins to distribute data |
[property] | string | Property to access in object arrays. Supports nested properties (ex: 'propA.propB') |
number
Performs a rule of three calculation
Kind: static method of MathFunctions
Returns: number
- The result of the rule of three
Param | Type | Description |
---|---|---|
ifThis | number | First premise |
isThis | number | First result |
thenThat | number | Second premise |
FAQs
Helper with misc. math functions such as sums, averages, max, min, etc
The npm package math-helper-functions receives a total of 130 weekly downloads. As such, math-helper-functions popularity was classified as not popular.
We found that math-helper-functions demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.