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.3 to 0.2.4

14

Banker.js

@@ -41,7 +41,11 @@

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 )
let variance = 0
if (list.length > 0) {
const squareDiffs = list.map((value) => {
const diff = value - avg;
return diff * diff;
})
variance = Services.toFixedNumber( Math.sqrt( squareDiffs.reduce((acc, current) => acc + current, 0) / list.length ), decimalPlaces )
}
return {

@@ -48,0 +52,0 @@ sum,

{
"name": "bankers-math",
"version": "0.2.3",
"version": "0.2.4",
"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