summaryrefslogtreecommitdiff
path: root/src/mongo/db/matcher
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2015-02-03 18:40:35 -0500
committerSiyuan Zhou <siyuan.zhou@mongodb.com>2015-02-05 13:53:16 -0500
commit93e72f29f5d58dff1229c8db9db62b4f02324117 (patch)
tree975970f00278485ab112767e2758d290da588665 /src/mongo/db/matcher
parent68fe6570d19c744f84861b70d541e8b46ac24935 (diff)
downloadmongo-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.cpp5
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;