tscommons-core
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -15,2 +15,3 @@ export declare abstract class CommonsNumber { | ||
static mean(values: number[]): number | undefined; | ||
static standardDeviation(values: number[]): number | undefined; | ||
static modes(values: number[]): number[]; | ||
@@ -17,0 +18,0 @@ static median(values: number[]): number | undefined; |
@@ -93,2 +93,11 @@ "use strict"; | ||
} | ||
static standardDeviation(values) { | ||
if (values.length === 0) | ||
return 0; | ||
const mean = CommonsNumber.mean(values); | ||
if (mean === undefined) | ||
return undefined; | ||
return CommonsNumber.mean(values | ||
.map((value) => Math.pow((value - mean), 2))); | ||
} | ||
static modes(values) { | ||
@@ -95,0 +104,0 @@ if (values.length === 0) |
{ | ||
"name": "tscommons-core", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
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
330191
4222