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

ericvrp at codespeak.net ericvrp at codespeak.net
Sun Aug 14 21:33:03 CEST 2005


Author: ericvrp
Date: Sun Aug 14 21:33:03 2005
New Revision: 16070

Modified:
   pypy/dist/pypy/objspace/std/strutil.py
Log:
Better to use math.log10(float) consistently. 
Backends (at least llvm) will have no math.log10(int) implementation.



Modified: pypy/dist/pypy/objspace/std/strutil.py
==============================================================================
--- pypy/dist/pypy/objspace/std/strutil.py	(original)
+++ pypy/dist/pypy/objspace/std/strutil.py	Sun Aug 14 21:33:03 2005
@@ -332,7 +332,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)
         scale = 2L ** -bits
         pten = 10L ** -e
         m = (lr * scale) // pten



More information about the Pypy-commit mailing list