Commit ec96cbf0 authored by Petri Lehtinen's avatar Petri Lehtinen
Browse files

Encode reals correctly

This patch changes the sprintf format from "%0.17f" to "%.17g", as the
f format specifier doesn't print the exponent at all. This caused
losing precision in all but the most simple cases.

Because the g specifier doesn't print the decimal fraction or exponent
if they're not needed, a ".0" has to be appended by hand in these
cases. Otherwise the value's type changes from real to integer when
decoding again.

Thanks to Philip Grandinetti for reporting this issue.
parent 7c707a73
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment