Message358514
@mark.dickinson,
1) Where is your "`round` is giving the correct result in all cases"??
>>> round(4.395, 2)
4.39
2) I wrote it in my post using decimal punct:
''' Because, when the decimal string is converted to a binary floating-point number, it's
again replaced with a binary approximation:
Whose exact value is 5.765 --> 5.76499999999999968025576890795491635799407958984375
&&
2.675 --> 2.67499999999999982236431605997495353221893310546875
It means that, the 76(5) --> 5 replaced in a memory as 4.(999999999999)
&&
67(5) --> 5 replaced in a memory as 4.(999999999999) '''
3) round(2.6749999999999998, 2) --> this is the same with round(2.675, 2).
4) I also have a question for you.. Do you have any suggestion to solve this problem? |
|
Date |
User |
Action |
Args |
2019-12-16 19:04:09 | AVicennA | set | recipients:
+ AVicennA, terry.reedy, paul.moore, ronaldoussoren, mark.dickinson, tim.golden, ned.deily, steven.daprano, docs@python, zach.ware, koobs, steve.dower |
2019-12-16 19:04:09 | AVicennA | set | messageid: <1576523049.15.0.612807815225.issue39059@roundup.psfhosted.org> |
2019-12-16 19:04:09 | AVicennA | link | issue39059 messages |
2019-12-16 19:04:08 | AVicennA | create | |
|