MCPcopy Create free account
hub / github.com/avaxman/Directional / BinaryToFloat

Function BinaryToFloat

external/eigen/test/bfloat16_float.cpp:24–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22using Eigen::bfloat16;
23
24float BinaryToFloat(uint32_t sign, uint32_t exponent, uint32_t high_mantissa,
25 uint32_t low_mantissa) {
26 float dest;
27 uint32_t src = (sign << 31) + (exponent << 23) + (high_mantissa << 16) + low_mantissa;
28 memcpy(static_cast<void*>(&dest),
29 static_cast<const void*>(&src), sizeof(dest));
30 return dest;
31}
32
33template<typename T>
34 void test_roundtrip() {

Callers 1

test_conversionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected