From 511e4ca7e85f1cc0085c878f34d846c260a4cebd Mon Sep 17 00:00:00 2001 From: "Paul D. Fernhout" Date: Wed, 27 Dec 2017 21:03:21 -0500 Subject: [PATCH] Update math-trig.js FLOOR function The FLOOR function for the negative number case was not multiplying by significance after dividing by significance. That seemed inconsistent with with FLOOR.MATH and CEILING and the non-negative number case of FLOOR. --- lib/math-trig.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/math-trig.js b/lib/math-trig.js index cb186fc6..071e5d0c 100644 --- a/lib/math-trig.js +++ b/lib/math-trig.js @@ -346,7 +346,7 @@ exports.FLOOR = function(number, significance) { if (number >= 0) { return exports.ROUND(Math.floor(number / significance) * significance, precision); } else { - return -exports.ROUND(Math.ceil(Math.abs(number) / significance), precision); + return -exports.ROUND(Math.ceil(Math.abs(number) / significance) * significance, precision); } };