On Wed, 24 Sep 2014 16:15:18 GMT, Mickaël Bouchaud wrote:
Hi,
Is it possible not to loose precision when sending double value ?
In the exemple below I have 44.000083 and the result I get from vibe is 44.0001.
It seems that it use the default to!string to represent double.It seems to work find when sending values to vibe, I don't loose any precision.
This is indeed an issue currently. I'll fix the issue using formattedWrite("%.16g", num)
for the time being.
There have also been other requests for either caching the FP string representation, or for outputting arbitrary precision, so maybe there should really be a way to customize the output. One possibility would be to let the user define string toJsonFloat()
and static T from JsonFloat(string)
for custom types (with the requirement that both operate with valid JSON literals).