Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 44791 invoked from network); 9 Apr 2010 18:54:55 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Apr 2010 18:54:55 -0000 Received: (qmail 63402 invoked by uid 500); 9 Apr 2010 18:54:54 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 63358 invoked by uid 500); 9 Apr 2010 18:54:54 -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 63350 invoked by uid 99); 9 Apr 2010 18:54:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Apr 2010 18:54:54 +0000 X-ASF-Spam-Status: No, hits=0.3 required=10.0 tests=AWL,FREEMAIL_FROM,FREEMAIL_REPLY,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of paul.joseph.davis@gmail.com designates 209.85.211.175 as permitted sender) Received: from [209.85.211.175] (HELO mail-yw0-f175.google.com) (209.85.211.175) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Apr 2010 18:54:48 +0000 Received: by ywh5 with SMTP id 5so1759636ywh.13 for ; Fri, 09 Apr 2010 11:54:27 -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=/Dfd3HwUwCJesRWOoQYtj+dk/x4t4OXiZ/OsIRhu5Zo=; b=ILM1ADt+6lYEnWg23p4H2J55pSm1UeJRB7wXGNSwJI1CSJDbjPKTt2zhYWhUuCNFYR Sg6nfHkKnYMPUG0hEbxCHCT4I+YD274tm8F7jelKr5b4UqTBZc+4jAmm2AD1pkpNVlH1 /qQQKQEqEEyJtXgm2ymZtuatQQfCHfgOeua3k= 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=K2u1GEMSNCIHZ/cf9JbqnlTGUDtz9gptrKpjLA1qfARl++Eu95c+GC4fVVR3HU362F THesDliDECH+d7syuWI4ERcbm/ZxZ8kVGSxs15ZQq96h8qEATkh7hCRTN+Axpo9N6488 Gc7PGgp+bK7RzlUCOt6OhwznzsH6piTzmVE88= MIME-Version: 1.0 Received: by 10.100.119.9 with HTTP; Fri, 9 Apr 2010 11:54:07 -0700 (PDT) In-Reply-To: References: From: Paul Davis Date: Fri, 9 Apr 2010 14:54:07 -0400 Received: by 10.101.72.11 with SMTP id z11mr762605ank.51.1270839267326; Fri, 09 Apr 2010 11:54:27 -0700 (PDT) Message-ID: Subject: Re: Integers changed to float in Couch 0.11.0 To: user@couchdb.apache.org, fdmanana@gmail.com Content-Type: text/plain; charset=ISO-8859-1 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." >