MCPcopy Create free account
hub / github.com/F-Stack/f-stack / RM_SaveLongDouble

Function RM_SaveLongDouble

app/redis-6.2.6/src/module.c:4856–4863  ·  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

4854 * value to the RDB file. The double can be a valid number, a NaN or infinity.
4855 * It is possible to load back the value with RedisModule_LoadLongDouble(). */
4856void RM_SaveLongDouble(RedisModuleIO *io, long double value) {
4857 if (io->error) return;
4858 char buf[MAX_LONG_DOUBLE_CHARS];
4859 /* Long double has different number of bits in different platforms, so we
4860 * save it as a string type. */
4861 size_t len = ld2string(buf,sizeof(buf),value,LD_STR_HEX);
4862 RM_SaveStringBuffer(io,buf,len);
4863}
4864
4865/* In the context of the rdb_save method of a module data type, loads back the
4866 * 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