Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to serialize fpm::fixed #37

Open
Eren121 opened this issue Apr 22, 2022 · 2 comments
Open

Provide a way to serialize fpm::fixed #37

Eren121 opened this issue Apr 22, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@Eren121
Copy link
Contributor

Eren121 commented Apr 22, 2022

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.

@Eren121 Eren121 changed the title Serialization ? Is raw_value portable? Apr 22, 2022
@Eren121 Eren121 changed the title Is raw_value portable? [question] Is raw_value portable? Apr 22, 2022
@MikeLankamp MikeLankamp added the question Further information is requested label Apr 22, 2022
@Eren121 Eren121 changed the title [question] Is raw_value portable? Is raw_value portable? Apr 22, 2022
@MikeLankamp
Copy link
Owner

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.

@Eren121
Copy link
Contributor Author

Eren121 commented Apr 22, 2022

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.

@MikeLankamp MikeLankamp changed the title Is raw_value portable? Provide a way to serialize fpm::fixed Apr 22, 2022
@MikeLankamp MikeLankamp added enhancement New feature or request and removed question Further information is requested labels Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants