[pypy-svn] r16053 - pypy/dist/pypy/objspace/std

tismer at codespeak.net tismer at codespeak.net
Sat Aug 13 23:36:59 CEST 2005


Author: tismer
Date: Sat Aug 13 23:36:58 2005
New Revision: 16053

Modified:
   pypy/dist/pypy/objspace/std/strutil.py
Log:
provide float datatype to log10 instead of int

Modified: pypy/dist/pypy/objspace/std/strutil.py
==============================================================================
--- pypy/dist/pypy/objspace/std/strutil.py	(original)
+++ pypy/dist/pypy/objspace/std/strutil.py	Sat Aug 13 23:36:58 2005
@@ -448,7 +448,7 @@
     else:
         # compute a sufficiently large scale
         prec = MANTISSA_DIGITS * 2 + 22 # 128, maybe
-        bits = - (int(math.ceil(-e / math.log10(2) - 1e-10)) + prec)
+        bits = - (int(math.ceil(-e / math.log10(2.0) - 1e-10)) + prec)
         w_scale = lshift(space, w_1, mklong(space, -bits))
         w_pten = longup(space, w_10, mklong(space, -e), None)
         w_tmp = multip(space, w_lr, w_scale)



More information about the Pypy-commit mailing list