Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 31422 invoked from network); 12 Apr 2010 21:22:50 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Apr 2010 21:22:50 -0000 Received: (qmail 52556 invoked by uid 500); 12 Apr 2010 21:22:49 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 52514 invoked by uid 500); 12 Apr 2010 21:22:49 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 52506 invoked by uid 99); 12 Apr 2010 21:22:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Apr 2010 21:22:49 +0000 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=FREEMAIL_FROM,FREEMAIL_REPLY,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of zachary.zolton@gmail.com designates 74.125.82.180 as permitted sender) Received: from [74.125.82.180] (HELO mail-wy0-f180.google.com) (74.125.82.180) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Apr 2010 21:22:41 +0000 Received: by wyf22 with SMTP id 22so900825wyf.11 for ; Mon, 12 Apr 2010 14:22:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:received:message-id:subject:to:content-type; bh=0858Icopysnj+0A7QI5VVxRPismVo+8t+JEn9Z3Q20E=; b=J5lN6dA/oGFQxj1HxNgDJ3wx4xZU/2ZxbtBoQRz++dUAQXYEEwPfarICyswJW81LCH /+XqWapPkOpToz7z6DPpB+UtCtYiELzSwxImrFtjlZfiZbUJRbr0MhxfvPYL4UsIXH0i apaRWUbj97tY62ozIwqfilpvya79Nnq9ls3eE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=LYeoX+h+wUO2ZAaD7oEIAOhyhSvpQ2ImfFfk24mKvJjsga/9fOHeo8MxcyDKXE55Ot Mnr1LWMYlEdGsUbgAJPHp8Zd0/RfVye+l3kZRlz6q2Kg0tJIWJIDydv9VLUMIQyMStPG o1y8zJBG+WGGz7JrArEcr01YkTzu3OUI5gSX4= MIME-Version: 1.0 Received: by 10.216.175.148 with HTTP; Mon, 12 Apr 2010 14:22:01 -0700 (PDT) In-Reply-To: References: From: Zachary Zolton Date: Mon, 12 Apr 2010 16:22:01 -0500 Received: by 10.216.93.79 with SMTP id k57mr2747375wef.161.1271107341167; Mon, 12 Apr 2010 14:22:21 -0700 (PDT) Message-ID: Subject: Re: Integers changed to float in Couch 0.11.0 To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org LOL... I just got bit by this as well, did anyone ever open an JIRA ticket on this, or shall I? On Fri, Apr 9, 2010 at 1:54 PM, Paul Davis wrote: > On Fri, Apr 9, 2010 at 1:13 PM, Filipe David Manana wrote: >> On Fri, Apr 2, 2010 at 3:37 PM, Paul Davis wrote: >> >>> >>> Well, there's a limit to what can be stored in an integer remember. I >>> wouldn't really hold my breath for anything larger than 2147483648 >>> (2^31). The reason that Futon shows something different is because >>> JavaScript treats all numbers as floats and then at display time it'll >>> not display a fractional part if it's zero. >>> >>> I'm suprised that it used to work. Can anyone else on 0.10 verify >>> that? I'm not sure if I remember anything changing in the number >>> handling in mochijson or not. >>> >>> >> It changed: >> >> http://code.google.com/p/mochiweb/source/detail?r=43 >> >> JSON (and JavaScript) doesn't have a float or integer type. Everything is of >> type number. So anything greater than (2^31) - 1 can be represented without >> the decimal separator. >> >> In JavaScript: >> >>>>> n1 = 1270162450695 >> 1270162450695 >>>>> n2 = 1270162450695.0 >> 1270162450695 >>>>> n1 === n2 >> true >> >> I dunno why mochijson2 is making a distinction between integers vs floats. >> > > Oh how awesome. I have no idea why mochijson would do such a thing. > The only thing that's ever specified about numbers and limits is in > section 4 with the note "An implementation may set limits on the range > of numbers." > > Blargh. > >> >> >>> HTH, >>> Paul Davis >>> >> >> >> >> -- >> Filipe David Manana, >> fdmanana@gmail.com >> >> "Reasonable men adapt themselves to the world. >> Unreasonable men adapt the world to themselves. >> That's why all progress depends on unreasonable men." >> >