math.ceil

From ComputerCraft
Jump to: navigation, search

math.ceil
Function
Syntax
math.ceil()
Returns number
API math
Source Lua (source)

Return num rounded to the next whole integer.

ExampleExampleRound the value of user input
Read a line from the user, then print the ceiling of the number they entered.
Code
print(math.ceil(tonumber(read())))
Output Depends on what the user wrote. For instance, if they were to enter 0.2, the number printed would be 1.