summaryrefslogtreecommitdiffstats
path: root/Doc/library/decimal.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-01-03 21:15:20 (GMT)
committerGeorg Brandl <georg@python.org>2009-01-03 21:15:20 (GMT)
commit45f53370e7724282f136db6e547cf48b79f9186b (patch)
treeecef4c32c05d55c3408df927cfe6079473263faa /Doc/library/decimal.rst
parenta9ecbdade7271c30e691d8fab82085be68864624 (diff)
downloadcpython-45f53370e7724282f136db6e547cf48b79f9186b.zip
cpython-45f53370e7724282f136db6e547cf48b79f9186b.tar.gz
cpython-45f53370e7724282f136db6e547cf48b79f9186b.tar.bz2
Merged revisions 68214-68215,68217-68218 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r68214 | georg.brandl | 2009-01-03 20:44:48 +0100 (Sat, 03 Jan 2009) | 2 lines Make indentation consistent. ........ r68215 | georg.brandl | 2009-01-03 21:15:14 +0100 (Sat, 03 Jan 2009) | 2 lines Fix role name. ........ r68217 | georg.brandl | 2009-01-03 21:30:15 +0100 (Sat, 03 Jan 2009) | 2 lines Add rstlint, a little tool to find subtle markup problems and inconsistencies in the Doc sources. ........ r68218 | georg.brandl | 2009-01-03 21:38:59 +0100 (Sat, 03 Jan 2009) | 2 lines Recognize usage of the default role. ........
Diffstat (limited to 'Doc/library/decimal.rst')
-rw-r--r--Doc/library/decimal.rst24
1 files changed, 12 insertions, 12 deletions
diff --git a/Doc/library/decimal.rst b/Doc/library/decimal.rst
index 76ba2ee..abf4ec5 100644
--- a/Doc/library/decimal.rst
+++ b/Doc/library/decimal.rst
@@ -474,7 +474,7 @@ Decimal objects
>>> Decimal.from_float(float('-inf'))
Decimal('-Infinity')
- .. versionadded:: 2.7
+ .. versionadded:: 3.1
.. method:: fma(other, third[, context])
@@ -933,25 +933,25 @@ In addition to the three supplied contexts, new contexts can be created with the
If the argument is a string, no leading or trailing whitespace is
permitted.
-.. method:: create_decimal_from_float(f)
+ .. method:: create_decimal_from_float(f)
Creates a new Decimal instance from a float *f* but rounding using *self*
- as the context. Unlike the :method:`Decimal.from_float` class method,
+ as the context. Unlike the :meth:`Decimal.from_float` class method,
the context precision, rounding method, flags, and traps are applied to
the conversion.
.. doctest::
- >>> context = Context(prec=5, rounding=ROUND_DOWN)
- >>> context.create_decimal_from_float(math.pi)
- Decimal('3.1415')
- >>> context = Context(prec=5, traps=[Inexact])
- >>> context.create_decimal_from_float(math.pi)
- Traceback (most recent call last):
- ...
- decimal.Inexact: None
+ >>> context = Context(prec=5, rounding=ROUND_DOWN)
+ >>> context.create_decimal_from_float(math.pi)
+ Decimal('3.1415')
+ >>> context = Context(prec=5, traps=[Inexact])
+ >>> context.create_decimal_from_float(math.pi)
+ Traceback (most recent call last):
+ ...
+ decimal.Inexact: None
- .. versionadded:: 2.7
+ .. versionadded:: 3.1
.. method:: Etiny()