I have a bunch of 32-bit floating point values in a Python script, need to store them to disc and load them in a C++ tool.
Currently they are written in human-readable format. However the loss of precision is too big for my (numeric) application.
How do I best store (and load) them without loss?
You can use float.hex in python to get the hexadecimal representation of your number, then read it using the std::hexfloat stream manipulator in C++.
serializing float32 values in python and deserializing them in C++