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/2005-June/054492.html below:

[Python-Dev] Decimal floats as default (was: discussion aboutPEP239 and 240)

[Python-Dev] Decimal floats as default (was: discussion aboutPEP239 and 240) [Python-Dev] Decimal floats as default (was: discussion aboutPEP239 and 240)Facundo Batista facundobatista at gmail.com
Tue Jun 28 08:33:50 CEST 2005
On 6/27/05, Fredrik Johansson <fredrik.johansson at gmail.com> wrote:

> The context (as I envision it) would not be just a "binary float
> context", but a universal float context that lets you choose between
> binary and decimal precision at run time.

You mean something like this?

>>> from __future__ import new_float_behaviour
>>> 1.1
1.1
>>> import sys
>>> sys.float_context.binary = True
>>> 1.1
1.1000000000000001

I don't see why this couldn't be done. The default will be use decimal
fp, and you can switch to binary fp if you need silicon-speed (unless,
of course, you have decimal-on-silicon).

In decimal mode, the context will be a full one, in binary mode, it's
not mandatory to allow access to fpu flags, it could be just like now.

.    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