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

Aperta
#317 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
57/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
javascript
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
PureScript
Stelle
168
Fork
90
Merge medio
3g 1h
PR unite (30g)
1

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di purescript/purescript-prelude

Tutte le issue di purescript/purescript-prelude

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.