When two integers are divided with the //
integer operator, it returns the floor integer.
To have the ceil integer Only With Integer Operators (to avoid math.ceil
), I wrote the following lambda function :
ceilint=lambda x, y: x//y+ (1 if x%y else 0)
It works, but I wonder (as I am a Python beginner), if it is the right way to do that (n.b. I am sure that operands are integers) or if a better solution exists.
Thanks for answer.