提交 513ad866 编写于 作者: W Wei Wei

modify double type euqal compare in json_document.cc

上级 d1cafc08
......@@ -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<double>::epsilon();
case kInt64:
return data_.i == rhs.data_.i;
case kObject:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册