~ubuntu-branches/ubuntu/lucid/python2.6/lucid

« back to all changes in this revision

Viewing changes to Doc/library/decimal.rst

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-03-11 13:30:19 UTC
  • mto: (10.1.13 sid)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100311133019-sblbooa3uqrkoe70
Tags: upstream-2.6.5~rc2
ImportĀ upstreamĀ versionĀ 2.6.5~rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
.. seealso::
109
109
 
110
110
   * IBM's General Decimal Arithmetic Specification, `The General Decimal Arithmetic
111
 
     Specification <http://www2.hursley.ibm.com/decimal/decarith.html>`_.
 
111
     Specification <http://speleotrove.com/decimal/>`_.
112
112
 
113
113
   * IEEE standard 854-1987, `Unofficial IEEE 854 Text
114
114
     <http://754r.ucbtest.org/standards/854.pdf>`_.
531
531
 
532
532
   .. method:: is_normal()
533
533
 
534
 
      Return :const:`True` if the argument is a *normal* finite number.  Return
535
 
      :const:`False` if the argument is zero, subnormal, infinite or a NaN.
 
534
      Return :const:`True` if the argument is a *normal* finite non-zero
 
535
      number with an adjusted exponent greater than or equal to *Emin*.
 
536
      Return :const:`False` if the argument is zero, subnormal, infinite or a
 
537
      NaN.  Note, the term *normal* is used here in a different sense with
 
538
      the :meth:`normalize` method which is used to create canonical values.
536
539
 
537
540
      .. versionadded:: 2.6
538
541
 
560
563
   .. method:: is_subnormal()
561
564
 
562
565
      Return :const:`True` if the argument is subnormal, and :const:`False`
563
 
      otherwise.
 
566
      otherwise. A number is subnormal is if it is nonzero, finite, and has an
 
567
      adjusted exponent less than *Emin*.
564
568
 
565
569
      .. versionadded:: 2.6
566
570
 
603
607
 
604
608
      .. versionadded:: 2.6
605
609
 
606
 
   .. method:: logical_invert(other[, context])
 
610
   .. method:: logical_invert([context])
607
611
 
608
 
      :meth:`logical_invert` is a logical operation.  The argument must
609
 
      be a *logical operand* (see :ref:`logical_operands_label`).  The
 
612
      :meth:`logical_invert` is a logical operation.  The
610
613
      result is the digit-wise inversion of the operand.
611
614
 
612
615
      .. versionadded:: 2.6
636
639
 
637
640
   .. method:: max_mag(other[, context])
638
641
 
639
 
      Similar to the :meth:`max` method, but the comparison is done using the
 
642
      Similar to the :meth:`.max` method, but the comparison is done using the
640
643
      absolute values of the operands.
641
644
 
642
645
      .. versionadded:: 2.6
650
653
 
651
654
   .. method:: min_mag(other[, context])
652
655
 
653
 
      Similar to the :meth:`min` method, but the comparison is done using the
 
656
      Similar to the :meth:`.min` method, but the comparison is done using the
654
657
      absolute values of the operands.
655
658
 
656
659
      .. versionadded:: 2.6
1272
1275
         - at least one of ``x`` or ``y`` must be nonzero
1273
1276
         - ``modulo`` must be nonzero and have at most 'precision' digits
1274
1277
 
1275
 
      The result of ``Context.power(x, y, modulo)`` is identical to the result
1276
 
      that would be obtained by computing ``(x**y) % modulo`` with unbounded
1277
 
      precision, but is computed more efficiently.  It is always exact.
 
1278
      The value resulting from ``Context.power(x, y, modulo)`` is
 
1279
      equal to the value that would be obtained by computing ``(x**y)
 
1280
      % modulo`` with unbounded precision, but is computed more
 
1281
      efficiently.  The exponent of the result is zero, regardless of
 
1282
      the exponents of ``x``, ``y`` and ``modulo``.  The result is
 
1283
      always exact.
1278
1284
 
1279
1285
      .. versionchanged:: 2.6
1280
1286
         ``y`` may now be nonintegral in ``x**y``.