Skip to content

Round Function Issue #125160

@ghost

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

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions