Uses kEpsilon to compare floating point types (REAL and DOUBLE). For testing purposes.
| 916 | // Uses kEpsilon to compare floating point types (REAL and DOUBLE). |
| 917 | // For testing purposes. |
| 918 | bool 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 | |
| 932 | void variant::verifyArrayElements(const std::vector<variant>& inputs) { |
| 933 | if (!inputs.empty()) { |