Quiz Question 1 of 5
Which of the following correctly describes the outcome of using Math.floor()
and Math.ceil()
on negative floating-point numbers in JavaScript?
Choose the correct answer below:
-
A
Math.floor()
will round away from zero, andMath.ceil()
will round towards zero. -
B
Math.floor()
will round towards negative infinity, andMath.ceil()
will round towards positive infinity. -
C
Math.floor()
will round towards positive infinity, andMath.ceil()
will round towards negative infinity. -
D
Math.floor()
will round towards zero, andMath.ceil()
will round away from zero.