diff options
author | Siyuan Zhou <siyuan.zhou@mongodb.com> | 2015-02-03 18:40:35 -0500 |
---|---|---|
committer | Siyuan Zhou <siyuan.zhou@mongodb.com> | 2015-02-05 13:53:16 -0500 |
commit | 93e72f29f5d58dff1229c8db9db62b4f02324117 (patch) | |
tree | 975970f00278485ab112767e2758d290da588665 /src/mongo/db/matcher | |
parent | 68fe6570d19c744f84861b70d541e8b46ac24935 (diff) | |
download | mongo-93e72f29f5d58dff1229c8db9db62b4f02324117.tar.gz |
SERVER-8944 Use C++11 standard library functions for double NaN and Infinity detection
Diffstat (limited to 'src/mongo/db/matcher')
-rw-r--r-- | src/mongo/db/matcher/expression_leaf.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/db/matcher/expression_leaf.cpp b/src/mongo/db/matcher/expression_leaf.cpp index 22ad65ebbca..01e42775531 100644 --- a/src/mongo/db/matcher/expression_leaf.cpp +++ b/src/mongo/db/matcher/expression_leaf.cpp @@ -30,6 +30,7 @@ #include "mongo/db/matcher/expression_leaf.h" +#include <cmath> #include <pcrecpp.h> #include "mongo/bson/bsonobjiterator.h" @@ -121,8 +122,8 @@ namespace mongo { // Special case handling for NaN. NaN is equal to NaN but // otherwise always compares to false. - if (isNaN(e.numberDouble()) || isNaN(_rhs.numberDouble())) { - bool bothNaN = isNaN(e.numberDouble()) && isNaN(_rhs.numberDouble()); + if (std::isnan(e.numberDouble()) || std::isnan(_rhs.numberDouble())) { + bool bothNaN = std::isnan(e.numberDouble()) && std::isnan(_rhs.numberDouble()); switch ( matchType() ) { case LT: return false; |