haskell / haskell/binary

decode (encode NaN) /= NaN

オープン
#64 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Haskell
スター
120
フォーク
70
PR マージ指標
30日以内にマージされた PR はありません

説明

The IEEE "not-a-number" (NaN) value is not encoded properly, since `encode` uses `decodeFloat`, which is unspecified for NaN (cf. [Prelude](http://hackage.haskell.org/package/base-4.7.0.1/docs/Prelude.html#v:decodeFloat)).

Examples:

``` Haskell
(0 / 0 :: Double) = NaN
(decode (encode (0 / 0 :: Double)) :: Double) = -Infinity
(log (-1) :: Double) = NaN
(decode (encode (log (-1) :: Double)) :: Double) = Infinity
(0 / 0 :: Float) = NaN
(decode (encode (0 / 0 :: Float)) :: Float) = -Infinity
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Start by reading the Haskell binary package's encode and decode entry points, focusing on the Float and Double path that uses decodeFloat. Reproduce the listed NaN examples, then verify that encoding and decoding NaN preserves NaN for both types.

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

評価

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

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

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