MCPcopy Create free account
hub / github.com/apache/fory / copysign

Method copysign

cpp/fory/util/float16.h:180–183  ·  view source on GitHub ↗

copysign: take magnitude from |a|, sign from b — exact, bit operation.

Source from the content-addressed store, hash-verified

178 }
179 // copysign: take magnitude from |a|, sign from b — exact, bit operation.
180 [[nodiscard]] static float16_t copysign(float16_t a, float16_t b) noexcept {
181 return from_bits(
182 static_cast<uint16_t>((a.bits & 0x7FFFu) | (b.bits & 0x8000u)));
183 }
184 [[nodiscard]] static float16_t floor(float16_t a) noexcept {
185 return from_float(std::floor(a.to_float()));
186 }

Callers 3

_is_negative_zeroFunction · 0.80
_same_float_valueFunction · 0.80

Calls

no outgoing calls

Tested by 1