Arbitrary precision integer arithmetic: ceiling?

Steven D'Aprano steve at
Sun Mar 9 03:38:18 CET 2008

On Sun, 09 Mar 2008 02:16:39 +0000, Steven D'Aprano wrote:

> On Sat, 08 Mar 2008 15:26:35 -0800, Paul Rubin wrote:
>> Alasdair <amca01 at> writes:
>>> What is the best way of finding a ceiling of a quotient of arbitrary
>>> sized integers?
>> ceiling(a/b) = (a+b-1)//b
> Unfortunately that doesn't work reliably.

But of course you didn't intend it to work with floats, did you?


I'm just glad I didn't rant about people who think that floats are just 
like reals when they're not.


More information about the Python-list mailing list