[SERVER-40055] Bug in round for doubles with no second argument Created: 08/Mar/19 Updated: 29/Oct/23 Resolved: 07/May/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | 4.1.11 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Patrick Meredith | Assignee: | Charlie Swanson |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Operating System: | ALL |
| Sprint: | Query 2019-04-22, Query 2019-05-06, Query 2019-05-20 |
| Participants: |
| Description |
|
Ties round up when they should round to even, when no second argument to round is supplied. in pseudo code:
The problem here is that we are using `std::round` for doubles when no second argument is passed, otherwise we use `Decimal128::quantize`, with round ties to even. |
| Comments |
| Comment by Githook User [ 07/May/19 ] |
|
Author: {'name': 'Charlie Swanson', 'username': 'cswanson310', 'email': 'charlie.swanson@mongodb.com'}Message: |
| Comment by Patrick Meredith [ 08/Mar/19 ] |
|
Feel free to assign to me, since the bug is mine |