smath 1.13.1 → 1.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +3 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -231,7 +231,9 @@ function factors(n) {
231
231
  * ```
232
232
  */
233
233
  function round2(n, base) {
234
- return base ? base * Math.round(n / base) : n;
234
+ var rounded = base ? base * Math.round(n / base) : n;
235
+ var precision = 10; // Removes precision errors
236
+ return parseFloat(rounded.toFixed(precision));
235
237
  }
236
238
  /**
237
239
  * Calculate the relative normalized error or deviation from any
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smath",
3
- "version": "1.13.1",
3
+ "version": "1.13.2",
4
4
  "description": "Small math function library",
5
5
  "homepage": "https://npm.nicfv.com/",
6
6
  "bin": "dist/bin.js",