github / github/codeql-cli-binaries

float.toString() result is lossy

未關閉
#58 6 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
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.

貢獻指南

開啟貢獻指南

研究方向

Start by locating the implementation of the built-in float.toString() predicate and the CodeQL QL InlineExpectationsTest mentioned in the issue. Reproduce the 1.555555555 example and inspect the existing expected string handling; done means the string preserves the float's precision and the relevant expectation passes.

由索引模型根據 Issue 內容生成。

評估

領域
devtools
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。