Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8dad7df

Browse files
committed
Corrections to decimal flying circus: round returns a Decimal;
float should have a short repr.
1 parent 500c6ef commit 8dad7df

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Doc/library/decimal.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ floating point flying circus:
187187
>>> str(a)
188188
'1.34'
189189
>>> float(a)
190-
1.3400000000000001
191-
>>> round(a, 1) # round() first converts to binary floating point
192-
1.3
190+
1.34
191+
>>> round(a, 1)
192+
Decimal('1.3')
193193
>>> int(a)
194194
1
195195
>>> a * 5

0 commit comments

Comments
 (0)