github / github/codeql-cli-binaries
float.toString() result is lossy
オープン
Complexity: Medium
Engine: Evaluator
- 主要言語
- 言語のデータがありません
- スター
- 1k
- フォーク
- 184
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
It appears the built-in predicate `float.toString()` causes precision loss for the result. This can be irritating and also prevents using it in QL `InlineExpectationsTest` because there the expected `value` has to be a `string`.
CodeQL's `float` uses 64-bit and is therefore able to represent for example 1.555555555; yet `1.555555555.toString()` has 1.555556 as result.
These are not the same values, `1.555555555 = 1.555556` does not hold.
コントリビューションガイド
調査の方向性
まず、組み込みの float.toString() 述語の実装と、issue で言及されている CodeQL QL InlineExpectationsTest を見つけます。1.555555555 の例を再現し、既存の期待文字列の処理を調べます。文字列が float の精度を保持し、該当する期待値がパスすれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 領域
- devtools
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100