[Python-checkins] python/nondist/peps pep-0327.txt,1.6,1.7
goodger at users.sourceforge.net
goodger at users.sourceforge.net
Fri Jul 9 00:09:51 CEST 2004
Update of /cvsroot/python/python/nondist/peps
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18577
Modified Files:
pep-0327.txt
Log Message:
update from Facundo Batista
Index: pep-0327.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0327.txt,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** pep-0327.txt 6 Jul 2004 01:15:33 -0000 1.6
--- pep-0327.txt 8 Jul 2004 22:09:48 -0000 1.7
***************
*** 29,35 ****
This work is based on code and test functions written by Eric Price,
! Aahz and Tim Peters. Actually I'll work on the Decimal.py code in the
! sandbox (at python/nondist/sandbox/decimal in the SourceForge CVS
! repository). Much of the explanation in this PEP is taken from
Cowlishaw's work [2]_, comp.lang.python and python-dev.
--- 29,36 ----
This work is based on code and test functions written by Eric Price,
! Aahz and Tim Peters. Just before Python 2.4a1, the decimal.py
! `reference implementation`_ was moved into the standard library; along
! with the documentation and the test suite, this was the work of
! Raymond Hettinger. Much of the explanation in this PEP is taken from
Cowlishaw's work [2]_, comp.lang.python and python-dev.
***************
*** 359,370 ****
>>> d1 = Decimal("1e999999999") # at the exponent limit
>>> d1
! Decimal( (0, (1,), 999999999L) )
>>> d1 * 10 # exceed the limit, got infinity
! Decimal( (0, (0,), 'F') )
>>> getcontext().Emax = 1000000000 # increase the limit
>>> d1 * 10 # does not exceed any more
! Decimal( (0, (1, 0), 999999999L) )
>>> d1 * 100 # exceed again
! Decimal( (0, (0,), 'F') )
--- 360,381 ----
>>> d1 = Decimal("1e999999999") # at the exponent limit
>>> d1
! Decimal("1E+999999999")
>>> d1 * 10 # exceed the limit, got infinity
! Traceback (most recent call last):
! File "<pyshell#3>", line 1, in ?
! d1 * 10
! ...
! ...
! Overflow: above Emax
>>> getcontext().Emax = 1000000000 # increase the limit
>>> d1 * 10 # does not exceed any more
! Decimal("1.0E+1000000000")
>>> d1 * 100 # exceed again
! Traceback (most recent call last):
! File "<pyshell#3>", line 1, in ?
! d1 * 100
! ...
! ...
! Overflow: above Emax
***************
*** 690,701 ****
>>> # create a standard decimal instance
>>> Decimal("11.2233445566778899")
! Decimal( (0, (1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9), -16) )
>>>
>>> # create a decimal instance using the thread context
>>> thread_context = getcontext()
>>> thread_context.prec
! 9
! >>> thread_contex.create_decimal("11.2233445566778899")
! Decimal( (0, (1, 1, 2, 2, 3, 3, 4, 4, 6), -7L) )
>>>
>>> # create a decimal instance using other context
--- 701,712 ----
>>> # create a standard decimal instance
>>> Decimal("11.2233445566778899")
! Decimal("11.2233445566778899")
>>>
>>> # create a decimal instance using the thread context
>>> thread_context = getcontext()
>>> thread_context.prec
! 28
! >>> thread_context.create_decimal("11.2233445566778899")
! Decimal("11.2233445566778899")
>>>
>>> # create a decimal instance using other context
***************
*** 703,707 ****
>>> other_context.prec = 4
>>> other_context.create_decimal("11.2233445566778899")
! Decimal( (0, (1, 1, 2, 2), -2L) )
--- 714,718 ----
>>> other_context.prec = 4
>>> other_context.create_decimal("11.2233445566778899")
! Decimal("11.22")
***************
*** 1169,1179 ****
- power: ``power(d, n)``
! The following methods are to support decimal functionality through
! Context:
!
! - ``divmod(d, n)``
! - ``eq(d, d)``
! - ``gt(d, d)``
! - ``lt(d, d)``
These are methods that return useful information from the Context:
--- 1180,1185 ----
- power: ``power(d, n)``
! The ``divmod(d, n)`` method supports decimal functionality through
! Context.
These are methods that return useful information from the Context:
***************
*** 1199,1206 ****
========================
! To be included later:
! - code
! - test code
--- 1205,1216 ----
========================
! As of Python 2.4-alpha, the code has been checked into the standard
! library. The latest version is available from:
! http://cvs.sourceforge.net/viewcvs.py/python/python/dist/src/Lib/decimal.py
!
! The test cases are here:
!
! http://cvs.sourceforge.net/viewcvs.py/python/python/dist/src/Lib/test/test_decimal.py
More information about the Python-checkins
mailing list