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/2006-October/069484.html below:

[Python-Dev] Nondeterministic long-to-float coercion

[Python-Dev] Nondeterministic long-to-float coercionFacundo Batista facundobatista at gmail.com
Thu Oct 19 23:24:46 CEST 2006
2006/10/19, Raymond Hettinger <rhettinger at ewtllc.com>:

> My colleague got an odd result today that is reproducible on his build
> of Python (RedHat's distribution of Py2.4.2) but not any other builds
> ...
> >>> set(-19400000000 * (1/100.0) for i in range(10000))
> set([-194000000.0, -193995904.0, -193994880.0])

I neither can reproduce it in my Ubuntu, but analyzing the problem...
what about this?:

d = {}
for i in range(10000):
  val = -19400000000 * (1/100.0)
  d[val] = d.get(val, 0) + 1

or

d = {}
for i in range(10000):
  val = -19400000000 * (1/100.0)
  d.setdefault(val, []).append(i)

I think that is interesting to know,,,

- if in these structures the problem still happens...
- how many values go for each key, and which values.

Regards,

-- 
.    Facundo

Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/
More information about the Python-Dev mailing list

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