@daeinc/array
Advanced tools
Comparing version 0.3.1 to 0.3.2
/** | ||
* accumulate array values. ex. [50,50,50] => [50,100,150] | ||
* use original value while summing, but return value will be rounded | ||
* | ||
@@ -4,0 +5,0 @@ * TEST: float rounding error needs more testing |
@@ -7,2 +7,3 @@ "use strict"; | ||
* accumulate array values. ex. [50,50,50] => [50,100,150] | ||
* use original value while summing, but return value will be rounded | ||
* | ||
@@ -18,7 +19,6 @@ * TEST: float rounding error needs more testing | ||
for (let i = 0; i < arr.length; i++) { | ||
sum = sum + (0, math_1.roundF)(arr[i], 4); | ||
sum = (0, math_1.roundF)(sum, 4); | ||
sum = sum + arr[i]; | ||
result.push(sum); | ||
} | ||
return result; | ||
return result.map((val) => (0, math_1.roundF)(val, 4)); | ||
}; | ||
@@ -25,0 +25,0 @@ exports.accumulate = accumulate; |
{ | ||
"name": "@daeinc/array", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Array utilities", | ||
@@ -5,0 +5,0 @@ "types": "./dist/index.d.ts", |
Sorry, the diff of this file is not supported yet
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
13530
227