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 - npm Package Compare versions

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;

2

package.json
{
"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.&lt;number&gt;</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 |
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