| 892 | } // namespace |
| 893 | |
| 894 | bool variant::lessThanWithEpsilon(const variant& other) const { |
| 895 | if (other.kind_ != this->kind_) { |
| 896 | return other.kind_ < this->kind_; |
| 897 | } |
| 898 | if ((kind_ == TypeKind::REAL) or (kind_ == TypeKind::DOUBLE)) { |
| 899 | if (isNull() && !other.isNull()) { |
| 900 | return true; |
| 901 | } |
| 902 | if (isNull() || other.isNull()) { |
| 903 | return false; |
| 904 | } |
| 905 | |
| 906 | // If floating point values are roughly equal, then none of them is less. |
| 907 | if (equalsFloatingPointWithEpsilon(*this, other)) { |
| 908 | return false; |
| 909 | } |
| 910 | return *this < other; |
| 911 | } |
| 912 | |
| 913 | return BOLT_DYNAMIC_TYPE_DISPATCH_ALL(lessThan, kind_, *this, other); |
| 914 | } |
| 915 | |
| 916 | // Uses kEpsilon to compare floating point types (REAL and DOUBLE). |
| 917 | // For testing purposes. |
nothing calls this directly
no test coverage detected