JS Built-ins
← Math90 / 215
Mathceilbeginner

Math.ceil(-4.9) Equals -4

πŸ“– Usage Example
// Round up to the nearest integer
Math.ceil(4.2)   // β†’ 5
Math.ceil(-4.2)  // β†’ -4

Use Math.ceil() when you need to round a number up to the next whole integer.

Math.ceil(x)

Math.ceil(-4.9) returns -4, rounding toward zero.

Challenge: Verify that Math.ceil(-4.9) returns -4.

πŸ’‘ Hints (2)
  • β€’ Ceiling always moves toward +∞
  • β€’ -4 is "above" -4.9 on the number line, so it is the ceiling