Issue36288
Created on 2019-03-14 14:36 by MeeranRizvi, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg337921 - (view) | Author: MeeranRizvi (MeeranRizvi) | Date: 2019-03-14 14:36 | |
When using round() for calculation it gives the incorrect answer. For Example: round(1.5) >>2(Which is correct) But when we calculate: round(2.5) >>2(Should give 3 right?) |
|||
| msg337924 - (view) | Author: Rémi Lapeyre (remi.lapeyre) * | Date: 2019-03-14 14:40 | |
Thanks for submitting a report MeeranRizvi. This is the expected behavior, according to the IEEE 754 Python round to nearest even integer. This is called the bankers' rounding and is done (I think) to limitate the propagation of errors. I suggest we close this as not a bug. |
|||
| msg337925 - (view) | Author: Zachary Ware (zach.ware) * ![]() |
Date: 2019-03-14 14:44 | |
Please see the documentation for `round`, it explains this: https://docs.python.org/3/library/functions.html#round |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:12 | admin | set | github: 80469 |
| 2019-03-14 14:44:39 | zach.ware | set | components: - Build |
| 2019-03-14 14:44:13 | zach.ware | set | status: open -> closed nosy: + zach.ware, - remi.lapeyre messages: + msg337925 type: behavior -> |
| 2019-03-14 14:40:39 | remi.lapeyre | set | type: behavior messages:
+ msg337924 |
| 2019-03-14 14:36:08 | MeeranRizvi | create | |
