Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4950E9C0F for ; Tue, 14 Feb 2012 15:42:21 +0000 (UTC) Received: (qmail 30191 invoked by uid 500); 14 Feb 2012 15:42:20 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 30153 invoked by uid 500); 14 Feb 2012 15:42:20 -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 30142 invoked by uid 99); 14 Feb 2012 15:42:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Feb 2012 15:42:20 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Feb 2012 15:42:19 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 9F47E1B71FE for ; Tue, 14 Feb 2012 15:41:59 +0000 (UTC) Date: Tue, 14 Feb 2012 15:41:59 +0000 (UTC) From: "Paul Joseph Davis (Commented) (JIRA)" To: dev@couchdb.apache.org Message-ID: <59224148.36760.1329234119653.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1100489966.36054.1329221459545.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (COUCHDB-1410) Formally define number support 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-1410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13207783#comment-13207783 ] Paul Joseph Davis commented on COUCHDB-1410: -------------------------------------------- So this whole thing has really gotten blown out of proportion. While we have never formally documented what's going on internally, it can be described as such: A number is parsed into one of two forms: If the number contains a decimal point (".") or an exponent ("e" or "E") then the number is internally converted into an IEEE-754 floating point representation. This means that numbers containing either a decimal point or exponent are subject to the constraints of having a finite number of bits representing the number as is standard operating procedure. If a number does not contain a decimal point or exponent then it is parsed as an integer with (theoretically) no loss of precision (I think precision is bound by the amount of RAM IIRC but I don't promise there aren't any bugs). (Side note for Jiffy, technically, if a number fits in a signed 64bit representation, that is used. If not then parsing is deferred back to Erlang which handles parsing as a bignum). Literally, the only thing that's wrong in COUCHDB-1407 is that number formatting for doubles changed a wee bit and it has a simple fix and now people are getting all crazy about numbers and ignoring other places that JSON is munged. Blergh. > Formally define number support > ------------------------------ > > Key: COUCHDB-1410 > URL: https://issues.apache.org/jira/browse/COUCHDB-1410 > Project: CouchDB > Issue Type: Improvement > Affects Versions: 1.2 > Reporter: Robert Newson > Priority: Blocker > Fix For: 1.3 > > > The JSON spec has a very loose definition of Number. CouchDB, as a database, should have well-defined and first class support for numbers (both integral and decimal). The precision of number support should be formally specified as should the algorithm used to represent floating-point values, especially where an approximation must be made in the conversion. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira