fpm
fpm copied to clipboard
Provide a way to serialize fpm::fixed
Is the value returned by raw_value() the same across all platforms for a given fixed point value?
That's for serialization and sending into network and ensure portability.
I assume yes but just to be sure.
Hi @Eren121, it is the same in practice, but to be fair, FPM makes no guarantee for this. You could use raw_value() for now, but "officially" supporting platform-stable (and backwards-compatible) serialization would be a good feature request.
Thanks for your answer.
So I turn this into a feature request : making fpm::fixed serialization-friendly ^^
If it is with raw_value() or another method to ensure raw_value() backward-compatibility, that's not important.
Currently it could be implemented surely by serializing a char array (e.g. "1.4672") but, that seems a waste of memory space, therefore of performance.