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

Function equalsFloatingPointWithEpsilon

bolt/type/Variant.cpp:880–891  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

878}
879
880bool equalsFloatingPointWithEpsilon(const variant& a, const variant& b) {
881 if (a.isNull() or b.isNull()) {
882 return false;
883 }
884
885 if (a.kind() == TypeKind::REAL) {
886 return equalsFloatingPointWithEpsilonTyped<TypeKind::REAL, float>(a, b);
887 } else {
888 BOLT_CHECK_EQ(a.kind(), TypeKind::DOUBLE);
889 return equalsFloatingPointWithEpsilonTyped<TypeKind::DOUBLE, double>(a, b);
890 }
891}
892} // namespace
893
894bool variant::lessThanWithEpsilon(const variant& other) const {

Callers 2

lessThanWithEpsilonMethod · 0.85
equalsWithEpsilonMethod · 0.85

Calls 2

isNullMethod · 0.45
kindMethod · 0.45

Tested by

no test coverage detected