Start | mathceil
 

math.ceil(x)



Returnerar närmaste heltal uppnåt.

Heltalet uppåt

import math x = math.ceil(4.000001) print(x)
Samma sak som
import math x = 4.0001 x = math.trunc(x+1) print(x)
Testa egna siffror ...
import math y = float(input()) x = math.ceil(y) print(x)
13.94510269165 ms