GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.geeksforgeeks.org — math.ceil() function - Python - GeeksforGeeks math.ceil() function - PythonLast Updated : 3 Jun, 2026 math.ceil() function returns the smallest integer greater than or equal to a given number. It always rounds a value upward to the nearest whole number. If the input is already an integer, the same value is returned. This example shows how math.ceil() rounds a positive decimal number up to the next integer.
Output 34 Syntax
ExamplesExample 1: This example demonstrates how the function behaves with negative values. It still returns the smallest integer that is not less than the given number.
Output -13 Explanation: math.ceil(-13.1) returns -13 because it is the smallest integer greater than or equal to -13.1. Example 2: This example applies math.ceil() to a list of decimal numbers and prints their ceiling values one by one.
Output [3, 8, 102] Explanation: math.ceil(n) rounds each value in nums upward 2.3 -> 3, 7.01 -> 8, 101.96 -> 102. Comment Explore |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |