diff options
Diffstat (limited to 'Doc/library/decimal.rst')
-rw-r--r-- | Doc/library/decimal.rst | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/Doc/library/decimal.rst b/Doc/library/decimal.rst index fecfdeb..218d1c8 100644 --- a/Doc/library/decimal.rst +++ b/Doc/library/decimal.rst @@ -88,7 +88,7 @@ reset them before monitoring a calculation. * IEEE standard 854-1987, `Unofficial IEEE 854 Text <http://www.cs.berkeley.edu/~ejr/projects/754/private/drafts/854-1987/dir.html>`_. -.. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +.. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .. _decimal-tutorial: @@ -263,7 +263,7 @@ a single cast inside a loop. With context set and decimals created, the bulk of the program manipulates the data no differently than with other Python numeric types. -.. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +.. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .. _decimal-decimal: @@ -274,7 +274,7 @@ Decimal objects .. class:: Decimal([value [, context]]) - Constructs a new :class:`Decimal` object based from *value*. + Construct a new :class:`Decimal` object based from *value*. *value* can be an integer, string, tuple, or another :class:`Decimal` object. If no *value* is given, returns ``Decimal("0")``. If *value* is a string, it @@ -512,7 +512,7 @@ also have a number of specialized methods: correctly rounded using the :const:`ROUND_HALF_EVEN` rounding mode. -.. method: Decimal.logb([context]) +.. method:: Decimal.logb([context]) For a nonzero number, return the adjusted exponent of its operand as a :class:`Decimal` instance. If the operand is a zero then @@ -624,7 +624,7 @@ also have a number of specialized methods: .. method:: Decimal.quantize(exp[, rounding[, context[, watchexp]]]) - Returns a value equal to the first operand after rounding and + Return a value equal to the first operand after rounding and having the exponent of the second operand. >>> Decimal("1.41421356").quantize(Decimal("1.000")) @@ -645,8 +645,8 @@ also have a number of specialized methods: the given ``context`` argument; if neither argument is given the rounding mode of the current thread's context is used. - If watchexp is set (default), then an error is returned whenever - the resulting exponent is greater than Emax or less than Etiny. + If *watchexp* is set (default), then an error is returned whenever the + resulting exponent is greater than :attr:`Emax` or less than :attr:`Etiny`. .. method:: Decimal.radix() @@ -657,7 +657,7 @@ also have a number of specialized methods: .. method:: Decimal.remainder_near(other[, context]) - Computes the modulo as either a positive or negative value depending on which is + Compute the modulo as either a positive or negative value depending on which is closest to zero. For instance, ``Decimal(10).remainder_near(6)`` returns ``Decimal("-2")`` which is closer to zero than ``Decimal("4")``. @@ -720,7 +720,7 @@ also have a number of specialized methods: .. method:: Decimal.to_integral_exact([rounding[, context]]) - Round the argument to the nearest integer, signaling + Round to the nearest integer, signaling :const:`Inexact` or :const:`Rounded` as appropriate if rounding occurs. The rounding mode is determined by the ``rounding`` parameter if given, else by the given ``context``. If neither @@ -730,14 +730,14 @@ also have a number of specialized methods: .. method:: Decimal.to_integral_value([rounding[, context]]) - Rounds to the nearest integer without signaling :const:`Inexact` or + Round to the nearest integer without signaling :const:`Inexact` or :const:`Rounded`. If given, applies *rounding*; otherwise, uses the rounding method in either the supplied *context* or the current context. .. method:: Decimal.trim() - Returns its argument with *insignificant* trailing zeros removed. + Return the decimal with *insignificant* trailing zeros removed. Here, a trailing zero is considered insignificant either if it follows the decimal point, or if the exponent of the argument (that is, the last element of the :meth:`as_tuple` representation) is @@ -755,7 +755,7 @@ operands*. A *logical operand* is a :class:`Decimal` instance whose exponent and sign are both zero, and whose digits are all either :const:`0` or :const:`1`. -.. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +.. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .. _decimal-context: @@ -1023,7 +1023,7 @@ those for the :class:`Decimal` class and are only briefly recounted here. Converts a number to a string using scientific notation. -.. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +.. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .. _decimal-signals: @@ -1144,7 +1144,7 @@ The following table summarizes the hierarchy of signals:: Rounded Subnormal -.. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +.. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .. _decimal-notes: @@ -1241,7 +1241,7 @@ the following calculation returns a value equal to zero:: >>> 1 / Decimal('Infinity') Decimal("0E-1000000026") -.. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +.. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .. _decimal-threads: @@ -1279,7 +1279,7 @@ threads calling :func:`getcontext`. For example:: t3.start() . . . -.. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +.. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .. _decimal-recipes: @@ -1435,7 +1435,7 @@ to work with the :class:`Decimal` class:: return +s -.. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +.. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .. _decimal-faq: |