File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,26 @@ What's New in Python 2.2a0?
33
44Core
55
6+ - Float (and complex) literals in source code were evaluated to full
7+ precision only when running from a .py file; the same code loaded from a
8+ .pyc (or .pyo) file could suffer numeric differences starting at about the
9+ 12th significant decimal digit. For example, on a machine with IEEE-754
10+ floating arithmetic,
11+
12+ x = 9007199254740992.0
13+ print long(x)
14+
15+ printed 9007199254740992 if run directly from .py, but 9007199254740000
16+ if from a compiled (.pyc or .pyo) file. This was due to marshal using
17+ str(float) instead of repr(float) when building code objects. marshal
18+ now uses repr(float) instead, which should reproduce floats to full
19+ machine precision (assuming the platform C float<->string I/O conversion
20+ functions are of good quality).
21+
22+ This may cause floating-point results to change in some cases, and
23+ usually for the better, but may also cause numerically unstable
24+ algorithms to break.
25+
626- Dictionary objects now support the "in" operator: "x in dict" means
727 the same as dict.has_key(x).
828
You can’t perform that action at this time.
0 commit comments