]> granicus.if.org Git - python/commitdiff
Improve rst markup
authorRaymond Hettinger <python@rcn.com>
Thu, 14 Feb 2008 11:01:10 +0000 (11:01 +0000)
committerRaymond Hettinger <python@rcn.com>
Thu, 14 Feb 2008 11:01:10 +0000 (11:01 +0000)
Doc/library/decimal.rst

index 7af200c1cf2c9dd91d6969a8093c1ad55b333dd3..2f191bddca37ffa5d09fcf6470c25256136e604d 100644 (file)
@@ -1580,17 +1580,16 @@ be followed-up with a :meth:`quantize` step.
     Decimal('4314.24')
     >>> (a * b).quantize(TWOPLACES)     # Must quantize non-integer multiplication
     Decimal('325.62')
-    >>> (b / a).quantize(TWOPLACES)     # And quantize divisions
+    >>> (b / a).quantize(TWOPLACES)     # And quantize division
     Decimal('0.03')
 
 In developing fixed-point applications, it is convenient to define functions
 to handle the :meth:`quantize` step::
 
-    def mul(x, y, fp=TWOPLACES):
-        return (x * y).quantize(fp)
-    def div(x, y, fp=TWOPLACES):
-        return (x / y).quantize(fp)
-
+    >>> def mul(x, y, fp=TWOPLACES):
+    ...     return (x * y).quantize(fp)
+    >>> def div(x, y, fp=TWOPLACES):
+    ...     return (x / y).quantize(fp)
     >>> mul(a, b)                       # Automatically preserve fixed-point
     Decimal('325.62')
     >>> div(b, a)