decode (encode NaN) /= NaN
- 主要言語
- 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