MCPcopy Create free account
hub / github.com/apache/arrow / CompareLt

Function CompareLt

cpp/src/arrow/util/float16.h:163–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161 return (lhs.bits() == rhs.bits()) || (lhs.is_zero() && rhs.is_zero());
162 }
163 static constexpr bool CompareLt(Float16 lhs, Float16 rhs) {
164 if (lhs.signbit()) {
165 if (rhs.signbit()) {
166 // Both are negative
167 return lhs.bits() > rhs.bits();
168 } else {
169 // Handle +/-0
170 return !lhs.is_zero() || rhs.bits() != 0;
171 }
172 } else if (rhs.signbit()) {
173 return false;
174 } else {
175 // Both are positive
176 return lhs.bits() < rhs.bits();
177 }
178 }
179};
180
181static_assert(std::is_standard_layout_v<Float16>);

Callers 2

operator<Function · 0.85
operator<=Function · 0.85

Calls 1

signbitMethod · 0.80

Tested by

no test coverage detected