github / github/codeql-cli-binaries
float.toString() result is lossy
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 1k
- Fork
- 184
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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.
Hướng dẫn đóng góp
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Lĩnh vực
- devtools
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100