A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2004-March/043714.html below:

[Python-Dev] Expert floats

[Python-Dev] Expert floats [Python-Dev] Expert floatsJosiah Carlson jcarlson at uci.edu
Tue Mar 30 14:16:53 EST 2004
> That doesn't make sense to me.  If the .py file says "1.1" and the
> .pyc file says "1.1", you're going to get the same results.
> 
> In fact, you've just given a stronger reason for keeping "1.1".
> Currently, compiling a .py file containing "1.1" produces a .pyc file
> containing "1.1000000000000001".  .pyc files are supposed to be
> platform-independent.  If these files are then run on a platform with
> different floating-point precision, the .py and the .pyc will produce
> different results.

I believe (please correct me if I'm wrong), that Python floats, on all
platforms, are IEEE 754 doubles.  That is, Python uses the 8-byte FP,
not the (arguably worthless) 4-bit FP.  Cross-platform precision is not
an issue.

 - Josiah


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