[Python-checkins] r56931 - python/branches/decimal-branch/Lib/decimal.py

facundo.batista python-checkins at python.org
Sat Aug 11 19:58:56 CEST 2007


Author: facundo.batista
Date: Sat Aug 11 19:58:55 2007
New Revision: 56931

Modified:
   python/branches/decimal-branch/Lib/decimal.py
Log:

Changed the context before some doctests, as is specified in
the Spec.


Modified: python/branches/decimal-branch/Lib/decimal.py
==============================================================================
--- python/branches/decimal-branch/Lib/decimal.py	(original)
+++ python/branches/decimal-branch/Lib/decimal.py	Sat Aug 11 19:58:55 2007
@@ -3762,13 +3762,16 @@
     def next_minus(self, a):
         """Returns the largest representable number smaller than a.
 
+        >>> c = ExtendedContext.copy()
+        >>> c.Emin = -999
+        >>> c.Emax = 999
         >>> ExtendedContext.next_minus(Decimal('1'))
         Decimal("0.999999999")
-        >>> ExtendedContext.next_minus(Decimal('1E-1007'))
+        >>> c.next_minus(Decimal('1E-1007'))
         Decimal("0E-1007")
         >>> ExtendedContext.next_minus(Decimal('-1.00000003'))
         Decimal("-1.00000004")
-        >>> ExtendedContext.next_minus(Decimal('Infinity'))
+        >>> c.next_minus(Decimal('Infinity'))
         Decimal("9.99999999E+999")
         """
         return a.next_minus(context=self)
@@ -3776,13 +3779,16 @@
     def next_plus(self, a):
         """Returns the smallest representable number larger than a.
 
+        >>> c = ExtendedContext.copy()
+        >>> c.Emin = -999
+        >>> c.Emax = 999
         >>> ExtendedContext.next_plus(Decimal('1'))
         Decimal("1.00000001")
-        >>> ExtendedContext.next_plus(Decimal('-1E-1007'))
+        >>> c.next_plus(Decimal('-1E-1007'))
         Decimal("-0E-1007")
         >>> ExtendedContext.next_plus(Decimal('-1.00000003'))
         Decimal("-1.00000002")
-        >>> ExtendedContext.next_plus(Decimal('-Infinity'))
+        >>> c.next_plus(Decimal('-Infinity'))
         Decimal("-9.99999999E+999")
         """
         return a.next_plus(context=self)


More information about the Python-checkins mailing list