Allows round up and round ceil to work in the toNearest function.

This makes the new tests in the previous commit work.
A value of less than half of the first parameter of toNearest will now round up to the nearest multiplication of that first parameter.
pull/88/head
Lucia Velasco 7 years ago
parent caaba6d513
commit 4949869b5e

@ -2165,7 +2165,7 @@
// If y is not zero, calculate the nearest multiple of y to x.
if (y.d[0]) {
external = false;
if (rm < 4) rm = [4, 5, 7, 8][rm];
if (rm === 1 || rm === 3) rm = [4, 5, 7, 8][rm];
x = divide(x, y, 0, rm, 1).times(y);
external = true;
finalise(x);

Loading…
Cancel
Save