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

Function FormatFloat16Value

cpp/src/parquet/types.cc:176–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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