Skip to content

Int division bottom / (-1) exceeds 32bit integers range #317

Description

@katsujukou

I found a potential bug in EuclideanRing.

In PureScript, Int is defined as a signed 32-bit integer, but evaluating bottom / (-1) results in 2147483648, which exceeds the 32-bit range.
I think the JS implementation for integer division should include | 0 normalization to fix this.

cf: This issue doesn't occur with truncating division quot defined in purescript-integers, as it correctly includes | 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions