Skip to content

Commit f1b12e1

Browse files
committed
[Gardening] Use std::isnan
1 parent 9b75217 commit f1b12e1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

unittests/AST/ArithmeticEvaluator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,12 @@ struct EvaluationRule
107107

108108
// Evaluate the left- and right-hand sides.
109109
auto lhsValue = evalOrNaN(evaluator, Derived{binary->lhs});
110-
if (lhsValue != lhsValue) {
110+
if (std::isnan(lhsValue)) {
111111
brokeCycle = true;
112112
return lhsValue;
113113
}
114114
auto rhsValue = evalOrNaN(evaluator, Derived{binary->rhs});
115-
if (rhsValue != rhsValue) {
115+
if (std::isnan(rhsValue)) {
116116
brokeCycle = true;
117117
return rhsValue;
118118
}

0 commit comments

Comments
 (0)