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

Function UnpackDouble

src/codec/memcomparable_format.h:301–306  ·  view source on GitHub ↗

Function of type rdb_index_field_unpack_t Unpack a double by doing the reverse action of ChangeDoubleForSort (sql/filesort.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

299 allowed in the database.
300*/
301__attribute__((unused)) static int UnpackDouble(const void *src, void *dst) {
302 static double zero_val = 0.0;
303 static const uchar zero_pattern[8] = {128, 0, 0, 0, 0, 0, 0, 0};
304 return UnpackFloatingPoint(src, sizeof(double), DBL_EXP_DIG, zero_pattern,
305 (const uchar *)&zero_val, SwapDoubleBytes, dst);
306}
307
308/*
309 Read the next @param size bytes.

Callers 1

TEST_FFunction · 0.85

Calls 1

UnpackFloatingPointFunction · 0.85

Tested by 1

TEST_FFunction · 0.68