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

Function FormatFloat16Value

cpp/src/parquet/types.cc:179–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179std::string FormatFloat16Value(::std::string_view val) {
180 std::stringstream result;
181 // FromLittleEndian reads two bytes unconditionally; a truncated stat value
182 // may be shorter, so copy into a zero-padded buffer first.
183 std::array<uint8_t, 2> bytes{};
184 std::memcpy(bytes.data(), val.data(), std::min(bytes.size(), val.size()));
185 auto float16 = ::arrow::util::Float16::FromLittleEndian(bytes.data());
186 result << float16.ToFloat();
187 return result.str();
188}
189
190} // namespace
191

Callers 1

FormatStatValueFunction · 0.85

Calls 5

strMethod · 0.80
FromLittleEndianFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45
ToFloatMethod · 0.45

Tested by

no test coverage detected