Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 46723 invoked from network); 12 Jun 2010 22:28:36 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Jun 2010 22:28:36 -0000 Received: (qmail 58411 invoked by uid 500); 12 Jun 2010 22:28:36 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 58361 invoked by uid 500); 12 Jun 2010 22:28:35 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 58353 invoked by uid 99); 12 Jun 2010 22:28:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Jun 2010 22:28:35 +0000 X-ASF-Spam-Status: No, hits=-1516.7 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Jun 2010 22:28:34 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o5CMSDqo008289 for ; Sat, 12 Jun 2010 22:28:14 GMT Message-ID: <7302572.65391276381693459.JavaMail.jira@thor> Date: Sat, 12 Jun 2010 18:28:13 -0400 (EDT) From: "Adam Kocoloski (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Commented: (COUCHDB-796) Bignum support In-Reply-To: <6980179.53651276293623517.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12878321#action_12878321 ] Adam Kocoloski commented on COUCHDB-796: ---------------------------------------- >From dev@ On Jun 12, 2010, at 3:33 PM, Jason Smith wrote: > I hate to sidetrack conversation but I am unclear which Couch component has a bug. No problem, it's good that people understand this. There are two bugs. Bug #1 is that roundtrip encoding/decoding of big numbers in the Erlang VM is not supported: 1> Original = <<"[12345678911234567892123456789312345678941234567895]">>. <<"[12345678911234567892123456789312345678941234567895]">> 2> RoundTrip = couch_util:json_encode(couch_util:json_decode(Original)). [91,"1.2345678911234567e+49",93] 3> io:format("~s~n", [RoundTrip]). [1.2345678911234567e+49] Anything larger than a 32 bit integer is cast to a float. This is trivial to fix, and in fact the behavior is a regression since 0.10.x, when we were running a forked mochijson2. Bug #2 is that the Javascript VM represents Numbers as double precision floating-point, so anything with more than 15 digits of precision gets rounded off. I imagine your bigdecimal.js, but it would need the numbers as strings, right? Hence Bob's original suggestion > Bignum support > -------------- > > Key: COUCHDB-796 > URL: https://issues.apache.org/jira/browse/COUCHDB-796 > Project: CouchDB > Issue Type: Improvement > Components: Database Core > Affects Versions: 0.11 > Reporter: Robert Newson > Fix For: 1.0 > > > CouchDB uses spidermonkey which can only handle 32 bit integer values before overflowing. This might surprise users of map/reduce on large datasets. > Instead, alter mochijson2.erl to handle bignums and encode numeric values as strings. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.