mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
update {cs/cpp}/equality-on-floats to use the same alert-message/description
This commit is contained in:
@@ -21,4 +21,4 @@ where
|
|||||||
FloatingPointType and
|
FloatingPointType and
|
||||||
not ro.getAnOperand().isConstant() and // comparisons to constants generate too many false positives
|
not ro.getAnOperand().isConstant() and // comparisons to constants generate too many false positives
|
||||||
not left.(VariableAccess).getTarget() = right.(VariableAccess).getTarget() // skip self comparison
|
not left.(VariableAccess).getTarget() = right.(VariableAccess).getTarget() // skip self comparison
|
||||||
select ro, "Equality test on floating point values may not behave as expected."
|
select ro, "Equality checks on floating point values can yield unexpected results."
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* @name Equality check on floating point values
|
* @name Equality check on floating point values
|
||||||
* @description Equality checks on floating point values can yield unexpected results.
|
* @description Comparing results of floating-point computations with '==' or
|
||||||
|
* '!=' is likely to yield surprising results since floating-point
|
||||||
|
* computation does not follow the standard rules of algebra.
|
||||||
* @kind problem
|
* @kind problem
|
||||||
* @problem.severity warning
|
* @problem.severity warning
|
||||||
* @precision medium
|
* @precision medium
|
||||||
|
|||||||
Reference in New Issue
Block a user