Module Constants

Provides logic for determining constant expressions.

Import path

semmle.code.csharp.commons.Constants

Imports

csharp

The default C# QL library.

Predicates

comparesIdenticalValues

Holds if comparison test ct compares two structurally identical expressions.

comparesIdenticalValuesNan

Holds if comparison test ct compares two structurally identical expressions, in a way that may be used to perform a NaN-test. builtin is the name of an equivalent built-in NaN-test method, for example double.IsNaN().

isConstantComparison

Holds if comparison operation co is constant with the Boolean value b. For example, the comparison x > x is constantly false in

isConstantCondition

Holds if e is a condition that always evaluates to Boolean value b.