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

bankers-math

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bankers-math - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

17

Banker.js

@@ -33,5 +33,20 @@

})
return Services.toFixedNumber( Math.sqrt( squareDiffs.reduce((acc, current) => acc + current, 0) / list.length ), 6 )
return Math.sqrt( squareDiffs.reduce((acc, current) => acc + current, 0) / list.length )
},
analyseValues ( list, decimalPlaces = 6 ) {
let sum = Services.sum(list)
let avg = Services.toFixedNumber( list.length > 0 ? sum / list.length : 0, decimalPlaces )
const squareDiffs = list.map((value) => {
const diff = value - avg;
return diff * diff;
})
let variance = Services.toFixedNumber( Math.sqrt( squareDiffs.reduce((acc, current) => acc + current, 0) / list.length ), decimalPlaces )
return {
sum,
avg,
variance
}
},
defined (value) {

@@ -38,0 +53,0 @@ return value !== undefined && value !== null

2

package.json
{
"name": "bankers-math",
"version": "0.2.1",
"version": "0.2.2",
"description": "Helper function for Bankers' calculus",

@@ -5,0 +5,0 @@ "keywords": [

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