incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <>
Subject Re: Numerical accuracy and precision
Date Mon, 16 Jul 2012 14:27:44 GMT

Correct, numeric precision using the javascript view engine is limited to the 64-bit floating
point numbers that spidermonkey supports.

For arbitrary precision math, encode your values as strings and use a bignum library.

As an aside, if you're using floating-point numbers in an accounting context, you have already
fallen into sin.


On 16 Jul 2012, at 15:01, Samuel Williams wrote:

> Hi,
> I'm wondering, when using the JavaScript backend, is the numerical accuracy
> limited to that of JavaScript?
> How can we implement a numerically correct sum function, e.g. using a big
> integer implementation?
> Kind regards,
> Samuel

View raw message