MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / RM_SaveLongDouble

Function RM_SaveLongDouble

src/module.cpp:4965–4972  ·  view source on GitHub ↗

In the context of the rdb_save method of a module data type, saves a long double * value to the RDB file. The double can be a valid number, a NaN or infinity. * It is possible to load back the value with RedisModule_LoadLongDouble(). */

Source from the content-addressed store, hash-verified

4963 * value to the RDB file. The double can be a valid number, a NaN or infinity.
4964 * It is possible to load back the value with RedisModule_LoadLongDouble(). */
4965void RM_SaveLongDouble(RedisModuleIO *io, long double value) {
4966 if (io->error) return;
4967 char buf[MAX_LONG_DOUBLE_CHARS];
4968 /* Long double has different number of bits in different platforms, so we
4969 * save it as a string type. */
4970 size_t len = ld2string(buf,sizeof(buf),value,LD_STR_HEX);
4971 RM_SaveStringBuffer(io,buf,len);
4972}
4973
4974/* In the context of the rdb_save method of a module data type, loads back the
4975 * long double value saved by RedisModule_SaveLongDouble(). */

Callers

nothing calls this directly

Calls 2

ld2stringFunction · 0.85
RM_SaveStringBufferFunction · 0.85

Tested by

no test coverage detected