+ 9
What's the different between ceil & floor in python??
Ceil & floor functions are like same! I couldn't understand yet!
2 Answers
+ 18
Ceil rounds off a floating point value to its upper limit, e.g. 4.56 -> 5. Floor rounds off a floating point value to its lower limit, e.g. 3.67 -> 3.
+ 9
how to remember:
->imagine your home
"ceil" is roof of your home (take highest decimal number) and
"floor" is floor of your home(take lowest decimal number)
->take example
1) ceil and floor of 3.01
ceil->4(highest decimal number)
floor->3(lowest decimal number)
2)ceil and floor of 4.99
ceil->5(highest decimal number)
floor->4(lowest decimal number)
i hope you understand this........