-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed as not planned
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description
Bug report
Bug description:
When using the round function, there is an issue when I try to round the floating-point number that has a even number to the left of the decimal, and 5 to right of the decimal. For example 2.5, 4.5, 6.5 etc... Instead of rounding the number up , it rounds the number down. Example: Instead of rounding 2.5 up to 3, it rounds it down to 2. As I mentioned, this only happens to the even number. For odd numbers, it actually rounds the odd number up. Example: 3.5 will be rounded up to 4
print(round(2.5))
print(round(3.5))
print(round(4.5))
CPython versions tested on:
3.13
Operating systems tested on:
Windows
Metadata
Metadata
Assignees
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error