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/2004-March/043794.html below:

[Python-Dev] repr(1.1)

[Python-Dev] repr(1.1)Batista, Facundo FBatista at uniFON.com.ar
Wed Mar 31 08:11:48 EST 2004
Jewett, Jim wrote:

#- For that matter, Decimal might be a better default format for 1.1, if
#- a language were starting fresh.  It still wouldn't be 
#- perfect, though.
#- How many digits should 1.1/3 print?

That depends of your context.

If the precision in your context is set to 9 (default), it'll print:

>>> import Decimal
>>> d1 = Decimal.Decimal(1)
>>> d3 = Decimal.Decimal(3)
>>> d1 / d3
Decimal( (0, (3, 3, 3, 3, 3, 3, 3, 3, 3), -9L) )
>>> str(d1/d3)
'0.333333333'

.	Facundo

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