github / github/codeql-cli-binaries
float.toString() result is lossy
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 1k
- Fork
- 184
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Ambito
- devtools
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100