DocumentDb and floating point truncation

491 Views Asked by At

Hi I'm playing around with DocumentDb and are migrating some data into it. I saw that DocumentDb truncated "8.333333333333333333333333333" into "8.33333333333334".

What I understand so does DocumentDb support: https://en.wikipedia.org/wiki/Double-precision_floating-point_format standard which I understand is the same as C# Double?

But if I run double.Parse("8.333333333333333333333333333") I get "8.3333333333333339".

My main problem is that I want to be able to do the same truncation with C# code as DocumentDb does. But I don't understand how.

0

There are 0 best solutions below