]> granicus.if.org Git - python/commitdiff
Corrections to decimal flying circus: round returns a Decimal;
authorMark Dickinson <dickinsm@gmail.com>
Sun, 28 Jun 2009 20:36:54 +0000 (20:36 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Sun, 28 Jun 2009 20:36:54 +0000 (20:36 +0000)
float should have a short repr.

Doc/library/decimal.rst

index d548c0d1e149997a870c4d0d4604fc7e8b392fa4..4eba76872a3870d954d1314707dbd203b23595db 100644 (file)
@@ -187,9 +187,9 @@ floating point flying circus:
    >>> str(a)
    '1.34'
    >>> float(a)
-   1.3400000000000001
-   >>> round(a, 1)     # round() first converts to binary floating point
-   1.3
+   1.34
+   >>> round(a, 1)
+   Decimal('1.3')
    >>> int(a)
    1
    >>> a * 5