Skip to content

Commit bad4786

Browse files
authored
Use std::isnan instead of isnan (#39266)
1 parent 21f952c commit bad4786

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Framework/DataObjects/inc/MantidDataObjects/VectorColumn.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ template <class Type> class MANTID_DATAOBJECTS_DLL VectorColumn : public API::Co
131131
for (size_t j = 0; j < m_data[i].size(); j++) {
132132
double const left = static_cast<double>(m_data[i][j]);
133133
double const right = static_cast<double>(otherData[i][j]);
134-
if (nanEqual && std::isnan(left) && isnan(right)) {
134+
if (nanEqual && std::isnan(left) && std::isnan(right)) {
135135
continue;
136136
} else if (!Kernel::withinAbsoluteDifference(left, right, tolerance)) {
137137
return false;
@@ -154,7 +154,7 @@ template <class Type> class MANTID_DATAOBJECTS_DLL VectorColumn : public API::Co
154154
for (size_t j = 0; j < m_data[i].size(); j++) {
155155
double const left = static_cast<double>(m_data[i][j]);
156156
double const right = static_cast<double>(otherData[i][j]);
157-
if (nanEqual && std::isnan(left) && isnan(right)) {
157+
if (nanEqual && std::isnan(left) && std::isnan(right)) {
158158
continue;
159159
} else if (!Kernel::withinRelativeDifference(left, right, tolerance)) {
160160
return false;

Framework/Kernel/src/FloatingPointComparison.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ inline bool withinRelativeDifference(T const x, T const y, S const tolerance, MA
214214
// handles the case of infinities
215215
if (std::isinf(x) && std::isinf(y))
216216
// if both are +inf, return true; if both -inf, return true; else false
217-
return isnan(static_cast<S>(x - y));
217+
return std::isnan(static_cast<S>(x - y));
218218
S const num = static_cast<S>(absoluteDifference<T>(x, y));
219219
if (num <= std::numeric_limits<S>::epsilon()) {
220220
// if |x-y| == 0.0 (within machine tolerance), this test passes

0 commit comments

Comments
 (0)