github / github/codeql-cli-binaries
float.toString() result is lossy
- Langage dominant
- Aucune donnée de langage
- Étoiles
- 1k
- Forks
- 184
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Domaine
- devtools
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100