Skip to content

msgpack serialisation : float is treated as 64bit float, not 32bit float. #2196

@pfeatherstone

Description

@pfeatherstone

Example:

vector<float> buf(1024);
nlohmann::json j = {{"buf", buf}};
vector<uint8_t> msgpack = nlohmann::json::to_msgpack(j);
cout << msgpack.size() << endl;

I would expect this to print roughly ~ 5000, instead it is printing ~ 9000.
Going through GDB, it is treating the float type as 64bit.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions