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

オープン
#317 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
57/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
javascript
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
PureScript
スター
168
フォーク
90
平均マージ
3日 1時間
マージ済み PR(30日)
1

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

purescript/purescript-prelude のほかの issue

purescript/purescript-prelude の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。