math-helper-functions
Advanced tools
Comparing version 1.0.4 to 1.1.0
14
index.js
@@ -138,4 +138,18 @@ const {max, min, mean, median, histogram} = require('d3-array'); | ||
} | ||
/** | ||
* Performs a rule of three calculation | ||
* | ||
* @static | ||
* @param {number} ifThis First premise | ||
* @param {number} isThis First result | ||
* @param {number} thenThat Second premise | ||
* @returns {number} The result of the rule of three | ||
* @memberof MathFunctions | ||
*/ | ||
static ruleOfThree(ifThis, isThis, thenThat) { | ||
return (isThis * thenThat) / ifThis; | ||
} | ||
} | ||
module.exports = MathFunctions; |
{ | ||
"name": "math-helper-functions", | ||
"version": "1.0.4", | ||
"version": "1.1.0", | ||
"description": "Helper with misc. math functions such as sums, averages, max, min, etc", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -17,2 +17,3 @@ <a name="MathFunctions"></a> | ||
- [.calcDistribution(array, [numOfBins])](#MathFunctions.calcDistribution) ⇒ <code>object</code> | ||
- [.ruleOfThree(ifThis, isThis, thenThat)](#MathFunctions.ruleOfThree) ⇒ <code>number</code> | ||
@@ -32,3 +33,3 @@ <a name="new_MathFunctions_new"></a> | ||
**Kind**: static method of [<code>MathFunctions</code>](#MathFunctions) | ||
**Kind**: static method of [<code>MathFunctions</code>](#MathFunctions) | ||
**Returns**: <code>Number</code> - Max array value | ||
@@ -47,3 +48,3 @@ | ||
**Kind**: static method of [<code>MathFunctions</code>](#MathFunctions) | ||
**Kind**: static method of [<code>MathFunctions</code>](#MathFunctions) | ||
**Returns**: <code>Number</code> - Sum of array values | ||
@@ -62,3 +63,3 @@ | ||
**Kind**: static method of [<code>MathFunctions</code>](#MathFunctions) | ||
**Kind**: static method of [<code>MathFunctions</code>](#MathFunctions) | ||
**Returns**: <code>Number</code> - Min array value | ||
@@ -77,3 +78,3 @@ | ||
**Kind**: static method of [<code>MathFunctions</code>](#MathFunctions) | ||
**Kind**: static method of [<code>MathFunctions</code>](#MathFunctions) | ||
**Returns**: <code>Array.<number></code> - Min and max values in array | ||
@@ -92,3 +93,3 @@ | ||
**Kind**: static method of [<code>MathFunctions</code>](#MathFunctions) | ||
**Kind**: static method of [<code>MathFunctions</code>](#MathFunctions) | ||
**Returns**: <code>number</code> - Median of an array | ||
@@ -107,3 +108,3 @@ | ||
**Kind**: static method of [<code>MathFunctions</code>](#MathFunctions) | ||
**Kind**: static method of [<code>MathFunctions</code>](#MathFunctions) | ||
**Returns**: <code>Number</code> - Mean of an array | ||
@@ -122,3 +123,3 @@ | ||
**Kind**: static method of [<code>MathFunctions</code>](#MathFunctions) | ||
**Kind**: static method of [<code>MathFunctions</code>](#MathFunctions) | ||
**Returns**: <code>Number</code> - Percentage | ||
@@ -137,3 +138,3 @@ | ||
**Kind**: static method of [<code>MathFunctions</code>](#MathFunctions) | ||
**Kind**: static method of [<code>MathFunctions</code>](#MathFunctions) | ||
**Returns**: <code>object</code> - Distribution of the array's values | ||
@@ -145,1 +146,16 @@ | ||
| [numOfBins] | <code>number</code> | Number of bins to use (optional) | | ||
<a name="MathFunctions.ruleOfThree"></a> | ||
### MathFunctions.ruleOfThree(ifThis, isThis, thenThat) ⇒ <code>number</code> | ||
Performs a rule of three calculation | ||
**Kind**: static method of [<code>MathFunctions</code>](#MathFunctions) | ||
**Returns**: <code>number</code> - The result of the rule of three | ||
| Param | Type | Description | | ||
| -------- | ------------------- | -------------- | | ||
| ifThis | <code>number</code> | First premise | | ||
| isThis | <code>number</code> | First result | | ||
| thenThat | <code>number</code> | Second premise | |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20059
394
152