Int division `bottom / (-1)` exceeds 32bit integers range
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 57/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- javascript
- Domain
- backend
Research direction
Start by locating the JavaScript implementation of EuclideanRing integer division and compare it with the quot implementation in purescript-integers, which the issue says normalizes with | 0. Check the relevant division tests and add coverage for bottom / (-1); done when the result stays within the signed 32-bit Int range.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- PureScript
- Stars
- 168
- Forks
- 90
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from purescript/purescript-prelude
-
Difficulty 3/5 1-2 days Newbie friendliness 32/100
purescript/purescript-prelude#312 · 5 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
purescript/purescript-prelude#310 · 5 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 24/100
purescript/purescript-prelude#308 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
purescript/purescript-prelude#307 · 1 comment · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
purescript/purescript-prelude#305 · 5 comments ·
All issues in purescript/purescript-prelude
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
milind-soni/OpenMausBot#5829 ·
Maintainers usually reply within 1 day