[pypy-svn] r39835 - pypy/dist/pypy/lib
hpk at codespeak.net
hpk at codespeak.net
Sat Mar 3 18:21:22 CET 2007
Author: hpk
Date: Sat Mar 3 18:21:20 2007
New Revision: 39835
Removed:
pypy/dist/pypy/lib/_float_formatting.py
Modified:
pypy/dist/pypy/lib/_formatting.py
Log:
remove _float_formatting (shifted to user/mwh/pypy-formatting)
and traces of its (commented out) usage
Modified: pypy/dist/pypy/lib/_formatting.py
==============================================================================
--- pypy/dist/pypy/lib/_formatting.py (original)
+++ pypy/dist/pypy/lib/_formatting.py Sat Mar 3 18:21:20 2007
@@ -196,8 +196,6 @@
def isnan(v):
return v != v*1.0 or (v == 1.0 and v == 2.0)
-from _float_formatting import flonum2digits
-
class FloatFormatter(Formatter):
def eDigits(self, ds):
ds = ds[:self.prec + 1] + ['0'] * (self.prec + 1 - len(ds))
@@ -244,11 +242,6 @@
return FloatGFormatter('g', self.flags, self.width,
self.prec, self.value).format()
return self._formatd('f', v)
- #ds, k = flonum2digits(v)
- #digits = self.fDigits(ds, k)
- #if not self.flags.f_alt:
- # digits = digits.rstrip('.')
- #return digits
# system specific formatting. Linux does 3, Windows does 4...
# XXX this works only when we use geninterp!
@@ -263,10 +256,6 @@
class FloatEFormatter(FloatFormatter):
def _format(self, v):
return self._formatd('e', v)
- #ds, k = flonum2digits(v)
- #digits = self.eDigits(ds)
- #return "%%s%%c%%+0%dd" % _EF %(digits, self.char, k-1)
-
class FloatGFormatter(FloatFormatter):
# The description of %g in the Python documentation lies
@@ -275,23 +264,6 @@
# (One has to wonder who might care).
def _format(self, v):
return self._formatd('g', v)
- ## the following is btw. correct for marshal, now:
- #ds, k = flonum2digits(v)
- #ds = ds[:self.prec] # XXX rounding!
- #if -4 < k <= self.prec:
- # if k < 0:
- # self.prec -= k # grow prec for extra zeros
- # digits = self.fDigits(ds, k)
- # if not self.flags.f_alt:
- # digits = digits.rstrip('0').rstrip('.')
- # r = digits
- #else:
- # digits = self.eDigits(ds)
- # if not self.flags.f_alt:
- # digits = digits.rstrip('0').rstrip('.')
- # r = "%%se%%+0%dd" % _EF %(digits, k-1)
- #return r
-
class HexFormatter(Formatter):
# NB: this has 2.4 semantics wrt. negative values
More information about the Pypy-commit
mailing list