mirror of
https://github.com/github/codeql.git
synced 2026-05-07 14:41:41 +02:00
9 lines
243 B
C++
9 lines
243 B
C++
//wrong: could evaluate to 0 (false) due to rounding errors
|
|
23.42f == 23.42
|
|
|
|
//wrong: could evaluate to 1 (true) due to rounding errors
|
|
1000000000.0f == 1000000001.0f
|
|
|
|
//correct: use a margin of error to check equality
|
|
fabs(f1 - f2) < EPSILON
|