From 513ad866b28bfe82d88caa7a93a019fc1f260562 Mon Sep 17 00:00:00 2001 From: Wei Wei Date: Wed, 11 Feb 2015 10:19:52 +0800 Subject: [PATCH] modify double type euqal compare in json_document.cc --- utilities/document/json_document.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/document/json_document.cc b/utilities/document/json_document.cc index 2545741138..c73283d0c1 100644 --- a/utilities/document/json_document.cc +++ b/utilities/document/json_document.cc @@ -250,7 +250,7 @@ bool JSONDocument::operator==(const JSONDocument& rhs) const { case kBool: return data_.b == rhs.data_.b; case kDouble: - return data_.d == rhs.data_.d; + return std::fabs(data_.d - rhs.data_.d) <= std::numeric_limits::epsilon(); case kInt64: return data_.i == rhs.data_.i; case kObject: