हिंदी

How is math.ceil(89.7) different from math.floor (89.7)? - Computer Science (Python)

Advertisements
Advertisements

प्रश्न

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

टिप्पणी लिखिए

उत्तर

Floor: The function 'floor(x)' in Python returns the largest integer not greater than x. i.e. the integer part from the variable.

Ceil: The function 'ceil(x)' in Python returns the smallest integer not less than x i.e., the next integer on the RHS of the number line.

Hence, 'math.ceil(89.7)' will return 90 whereas 'math.floor(89.7)' will return 89.

shaalaa.com
Types of Module - Built-in Modules
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 7: Functions - Exercise [पृष्ठ १७०]

APPEARS IN

एनसीईआरटी Computer Science [English] Class 11
अध्याय 7 Functions
Exercise | Q 2. | पृष्ठ १७०
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×