On May 3, 9:49 pm, [email protected] (Victor Eijkhout) wrote: > Jerry Hill <[email protected]> wrote: > > >>> from __future__ import division > > >>> long1/long2 > > 0.5 > > Beautiful. Thanks so much guys.
And if for some reason you don't want to use the 'from __future__' import, then you can do long1.__truediv__(long2): >>> n = 765*10**1000 + 1 >>> n.__truediv__(n+1) 1.0 If you care about speed at all, I'd avoid the Fractions solution; it does an expensive and slow gcd computation. -- Mark -- http://mail.python.org/mailman/listinfo/python-list
