Firstly, is it fully supported to increment by floating values?
What level of floating-point precision is maintained?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
MongoDB does support incrementing by floating point values. This will cause the stored value to be converted to floating point if it is currently some other numeric type, which can lead to rounding errors if the previous value was a very large 64-bit integer.
All of the standard caveats involving floating point numbers apply. MongoDB, like JavaScript interpreters in web browsers, stores IEEE double precision (64-bit) floating point values. These values have 53 bits of precision. Intermediate calculations may be computed using 80-bit long doubles, but the final result is always stored as a 64-bit double precision floating point value.