MCPcopy Create free account
hub / github.com/bytedance/bolt / equalsWithEpsilon

Method equalsWithEpsilon

bolt/type/Variant.cpp:918–930  ·  view source on GitHub ↗

Uses kEpsilon to compare floating point types (REAL and DOUBLE). For testing purposes.

Source from the content-addressed store, hash-verified

916// Uses kEpsilon to compare floating point types (REAL and DOUBLE).
917// For testing purposes.
918bool variant::equalsWithEpsilon(const variant& other) const {
919 if (other.kind_ != this->kind_) {
920 return false;
921 }
922 if (other.isNull()) {
923 return this->isNull();
924 }
925 if ((kind_ == TypeKind::REAL) or (kind_ == TypeKind::DOUBLE)) {
926 return equalsFloatingPointWithEpsilon(*this, other);
927 }
928
929 return BOLT_DYNAMIC_TYPE_DISPATCH_ALL(equals, kind_, *this, other);
930}
931
932void variant::verifyArrayElements(const std::vector<variant>& inputs) {
933 if (!inputs.empty()) {

Callers 4

equalWithEpsilonMethod · 0.80
areEqualMethod · 0.80
compareOrderedPartitionsFunction · 0.80
TESTFunction · 0.80

Calls 2

isNullMethod · 0.95

Tested by 4

equalWithEpsilonMethod · 0.64
areEqualMethod · 0.64
compareOrderedPartitionsFunction · 0.64
TESTFunction · 0.64