Closed rockingdice closed 1 year ago
Hi @rockingdice, you can use the streaming operators to convert deterministically between fpm values and strings, e.g.:
fpm::fixed_16_16 f;
std::stringstream("3.1415926") >> f;
There's also an open request to support the equivalent of std::from_chars
: #2.
Does this solve your issue?
Yes, it does! Thanks for the quick reply!
oh, i just realized if
Hi @rockingdice, you can use the streaming operators to convert deterministically between fpm values and strings, e.g.:
fpm::fixed_16_16 f; std::stringstream("3.1415926") >> f;
There's also an open request to support the equivalent of
std::from_chars
: #2.Does this solve your issue?
Will the std::from_chars
be implemented?
What I'm doing is to read float numbers from a JSON file, and I don't know how to read it into a fpm value. I'm making a deterministic app, so I tried to avoid any float number when possible.
Like this one:
How to convert it to a fpm value with deterministic?