mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Corrections to decimal flying circus: round returns a Decimal;
float should have a short repr.
This commit is contained in:
parent
500c6ef67f
commit
8dad7df2b0
1 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue