Skip to content

behaviour of the modulo operator #129297

Closed as not planned
Closed as not planned
@SerpentByte

Description

@SerpentByte

Feature or enhancement

Proposal:

The behaviour of the modulo operator should be made consistent across Python and C/C++.

3%2 # this is 1
-3%2 # this can be represented as -1 or 1 depending of the divisor.
# -3%2 is -1 in C/C++.

Has this already been discussed elsewhere?

I don't think so.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions