1
0
mirror of https://github.com/MikeMcl/decimal.js.git synced 2026-09-24 21:04:32 +00:00

Code Review Changes: Updates test file and void check

Also removes superfluous line that the tests now cater for.
This commit is contained in:
Lucia Velasco
2018-03-05 09:10:46 +00:00
parent 2c3198d555
commit caed629d5a
2 changed files with 139 additions and 70 deletions

View File

@@ -2150,7 +2150,11 @@
rm = Ctor.rounding;
} else {
y = new Ctor(y);
if (rm !== void 0) checkInt32(rm, 0, 8);
if (rm === void 0) {
rm = Ctor.rounding;
} else {
checkInt32(rm, 0, 8);
}
// If x is not finite, return x if y is not NaN, else NaN.
if (!x.d) return y.s ? x : y;
@@ -2165,7 +2169,6 @@
// If y is not zero, calculate the nearest multiple of y to x.
if (y.d[0]) {
external = false;
if (rm === 1 || rm === 3) rm = [4, 5, 7, 8][rm];
x = divide(x, y, 0, rm, 1).times(y);
external = true;
finalise(x);