MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / UnpackFloat

Function UnpackFloat

src/codec/memcomparable_format.h:286–291  ·  view source on GitHub ↗

Function of type rdb_index_field_unpack_t Unpack a float by doing the reverse action of Field_float::make_sort_key (sql/field.cc). Note that this only works on IEEE values. Note also that this code assumes that NaN and +/-Infinity are never allowed in the database. */

Source from the content-addressed store, hash-verified

284 allowed in the database.
285*/
286__attribute__((unused)) static int UnpackFloat(const void *src, void *dst) {
287 static float zero_val = 0.0;
288 static const uchar zero_pattern[4] = {128, 0, 0, 0};
289 return UnpackFloatingPoint(src, sizeof(float), FLT_EXP_DIG, zero_pattern,
290 (const uchar *)&zero_val, SwapFloatBytes, dst);
291}
292
293/*
294 Function of type rdb_index_field_unpack_t

Callers 1

TEST_FFunction · 0.85

Calls 1

UnpackFloatingPointFunction · 0.85

Tested by 1

TEST_FFunction · 0.68