A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-July/037228.html below:

[Spambayes] Question (orpossibly a bug report)

[Python-Dev] Re: [spambayes-dev] RE: RE: [Spambayes] Question (orpossibly a bug report) [Python-Dev] Re: [spambayes-dev] RE: RE: [Spambayes] Question (orpossibly a bug report)Scott David Daniels Scott.Daniels@Acm.Org
Fri, 25 Jul 2003 06:17:50 -0700
I've been seeing a lot of "we'll have to use float(123)/100"
messages floating around, and I'd like to point out there is an
atof-able form for floating point numbers:
           256.7654e-7  =  2567654e-11

def safestr(floatstr):
     """Return a locale-safe version of C-locale-generated floatstr"""
     try:
	decpos = floatstr.index('.')
     except ValueError:
	return floatstr
     try:
	exppos = floatstr.lower().index('e')
     except ValueError:
	ebias = 0
	exppos = len(sv)
     else:
	ebias = int(floatstr[exppos+1:])
     return '%s%se%s' % (floatstr[:decpos], floatstr[decpos+1:exppos],
			ebias + 1 - exppos + decpos)


floating-point-need-not-use-fractional-mantissas-ly yours,
-Scott David Daniels





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4