KnowledgeBoat Logo
|

Computer Science

How is math.ceil(89.7) different from math.floor(89.7)?

Python Modules

2 Likes

Answer

The math.ceil(x) returns the smallest integer greater than or equal to x. In other words, it rounds up to the nearest integer. For 89.7, the smallest integer greater than 89.7 is 90. While math.floor(x) returns the largest integer less than or equal to x. In other words, it rounds down to the nearest integer. For 89.7, the largest integer less than 89.7 is 89.

Answered By

1 Like


Related Questions