MCPcopy Create free account
hub / github.com/numpy/numpy / npy_doublebits_to_halfbits

Function npy_doublebits_to_halfbits

numpy/core/src/npymath/halffloat.cpp:209–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207}
208
209npy_uint16 npy_doublebits_to_halfbits(npy_uint64 d)
210{
211 if constexpr (Half::kNativeConversion<double>) {
212 return BitCast<uint16_t>(Half(BitCast<double>(d)));
213 }
214 else {
215 return half_private::FromDoubleBits(d);
216 }
217}
218
219npy_uint32 npy_halfbits_to_floatbits(npy_uint16 h)
220{

Callers

nothing calls this directly

Calls 2

HalfClass · 0.85
FromDoubleBitsFunction · 0.85

Tested by

no test coverage detected