New submission from Raymond Hettinger: Just before the sign bit is restored, add code with the following effect:
while not top&1: top >>= 1 e += 1 Tests: math.pi --> (884279719003555, 281474976710656) 7.5 --> (15, 2) 0.875 --> (7, 8) ---------- files: tmp_float_conv.py messages: 61975 nosy: rhettinger severity: normal status: open title: float.as_integer_ratio() needs to return fraction in lowest terms Added file: http://bugs.python.org/file9344/tmp_float_conv.py __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1996> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com