On 21 January 2016 at 21:17, Marko Rauhamaa <ma...@pacujo.net> wrote: > Well, then there's: > > def intdiv(a, b): > return int(a / b)
That depends on how accurate you need it to be >>> def intdiv(a, b): ... return a//b if (a < 0) == (b < 0) else -(-a//b) ... >>> num = 3**171 >>> num 3870210234510307998744588107535211184800325224934979257430349324033792477926791547 >>> num2 = 4**80 >>> num2 1461501637330902918203684832716283019655932542976 >>> intdiv(num, num2) 2648105301871818722187687529062555 >>> int(num/num2) 2648105301871818477801931416797184 -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list