repositories
/
e-mobility-charging-stations-simulator.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b2c628b
)
refactor: cleanup standard deviation implementation
author
Jérôme Benoit
<jerome.benoit@sap.com>
Sat, 16 Sep 2023 08:27:45 +0000
(10:27 +0200)
committer
Jérôme Benoit
<jerome.benoit@sap.com>
Sat, 16 Sep 2023 08:27:45 +0000
(10:27 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/utils/StatisticUtils.ts
patch
|
blob
|
blame
|
history
diff --git
a/src/utils/StatisticUtils.ts
b/src/utils/StatisticUtils.ts
index 7f338ff9d08d88651a6d012b036ef73f43946ec5..f0bd1f28bbc789500e3b0ae41c966dbf9f3ac241 100644
(file)
--- a/
src/utils/StatisticUtils.ts
+++ b/
src/utils/StatisticUtils.ts
@@
-69,8
+69,7
@@
export const stdDeviation = (
dataSetAverage: number = average(dataSet),
): number => {
return Math.sqrt(
- dataSet.reduce((accumulator, num) => {
- return accumulator + Math.pow(num - dataSetAverage, 2);
- }, 0) / dataSet.length,
+ dataSet.reduce((accumulator, num) => accumulator + Math.pow(num - dataSetAverage, 2), 0) /
+ dataSet.length,
);
};