mirror of
https://github.com/github/codeql.git
synced 2026-05-04 13:15:21 +02:00
Merge pull request #12709 from MathiasVP/disable-rounding-2
C++: Disable floating point rounding in range analysis
This commit is contained in:
@@ -16,14 +16,5 @@ module FloatDelta implements DeltaSig {
|
||||
Delta fromInt(int n) { result = n }
|
||||
|
||||
bindingset[f]
|
||||
Delta fromFloat(float f) {
|
||||
result =
|
||||
min(float diff, float res |
|
||||
diff = (res - f) and res = f.ceil()
|
||||
or
|
||||
diff = (f - res) and res = f.floor()
|
||||
|
|
||||
res order by diff
|
||||
)
|
||||
}
|
||||
Delta fromFloat(float f) { result = f }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user