float32 refuses a value that should saturate to an infinity
まだ誰も着手していません。
評価
調査の方向性
compact_encoding.float32 エンコーダーから始め、float32-overflow という名前の compact-encoding-test コーパスケースを再現し、issue に記載されている struct.pack の動作と比較してください。完了とは、4e38 をエンコードしても OverflowError が発生しなくなり、参照バイト 0000807f を生成し、適合性ケースが通ることを意味します。
索引モデルが issue の本文から書いたものです。
説明
Found by running the compact-encoding-test conformance corpus against this port.
float32 refuses a value too large for binary32 instead of saturating to an infinity:
import compact_encoding as c
c.encode(c.float32, 4e38) # OverflowError: float too large to pack with f format
The reference writes 0000807f, which reads back as infinity. That is what IEEE 754 round-to-nearest gives when a double is narrowed to binary32 and the result is out of range, so the reference's behaviour is the standard one here rather than a quirk.
The cause looks like struct.pack surfacing rather than a decision:
import struct
struct.pack('<f', 4e38) # OverflowError: float too large to pack with f format
The corpus case is float32-overflow, citing float-overflows-to-an-infinity: "a value too large for the width becomes an infinity rather than a refusal, so float32 writes 4e38 as 0000807f and loses it. A float codec refuses no number it is given: what the width cannot hold it rounds, and what the width cannot reach becomes an infinity."
- 主要言語
- Python
- スター
- 1
- フォーク
- 1
- 平均マージ
- 4日 6時間
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
holepunchto/compact-encoding-python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 75/100
holepunchto/compact-encoding-python の issue をすべて見る
似ている issue
-
Project submission:オープン
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
slavakurilyak/awesome-ai-agents#845 ·
メンテナーはふだん 1 日以内に返信
-
tests: pin that the atomic writers in utils/paths.py stage the temporary file in the target's directory対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンdifficulty:2 enhancement good first issue
難易度 1/5 1〜3時間 初心者へのやさしさ 92/100
MakazhanAlpamys/Soup#2178 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] dcg.waggr permutation p-values are folded twice, so near-zero scores get the smallest p-valuesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
scverse/rapids-singlecell#854 ·
メンテナーはふだん 1 日以内に返信
-
Slang input: int8_t4_packed and uint8_t4_packed are copied into CrossGL対応中かも @ninglinLiu が今日担当しました。 オープンarea:frontend backend:slang bug direction:input
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
random_elements(unique=True) on an OrderedDict: ZeroDivisionError once only zero weights remain, AssertionError with use_weighting=False対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 13 日以内に返信