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

Function npy_floatbits_to_halfbits

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

Source from the content-addressed store, hash-verified

197 */
198
199npy_uint16 npy_floatbits_to_halfbits(npy_uint32 f)
200{
201 if constexpr (Half::kNativeConversion<float>) {
202 return BitCast<uint16_t>(Half(BitCast<float>(f)));
203 }
204 else {
205 return half_private::FromFloatBits(f);
206 }
207}
208
209npy_uint16 npy_doublebits_to_halfbits(npy_uint64 d)
210{

Callers

nothing calls this directly

Calls 2

HalfClass · 0.85
FromFloatBitsFunction · 0.85

Tested by

no test coverage detected