Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 45540 invoked from network); 12 Dec 2009 19:04:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Dec 2009 19:04:32 -0000 Received: (qmail 40443 invoked by uid 500); 12 Dec 2009 19:04:31 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 40355 invoked by uid 500); 12 Dec 2009 19:04:31 -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 40345 invoked by uid 99); 12 Dec 2009 19:04:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Dec 2009 19:04:31 +0000 X-ASF-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of b.candler@pobox.com designates 208.72.237.25 as permitted sender) Received: from [208.72.237.25] (HELO sasl.smtp.pobox.com) (208.72.237.25) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Dec 2009 19:04:28 +0000 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 791B7878D5; Sat, 12 Dec 2009 14:04:05 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=date:from:to :cc:subject:message-id:references:mime-version:content-type :in-reply-to; s=sasl; bh=5mY240i4FWX0Kk0UdOddLZreoBk=; b=VcNBoko ub2/w6FUVc2YDB2d0aiADqRz/87VOYkY53Lfub5nxdBootKZ/iBfwzn/w8kTbwdW 4WRbA2bLWKUknOZK/0WkVxmSZsJqfcUEi2b8UewFOg+cHEMNbzoumV8IQcWuaQfS vty0GfEW7Hho0i2zK0q5h9IC+3bG5uuX0kYM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=date:from:to:cc :subject:message-id:references:mime-version:content-type :in-reply-to; q=dns; s=sasl; b=FLmZLzoyUWJ4V/0jMo3T7Tn5LstYrzbTD Dw6MTdI39XWZRcmlXpztG4TM/X3q6Hr7+nAOp+YlPTCZE/Fppxsly8zx3aeL2iyA +AtzX5X5xjx+94tJcShYrDa8hfdoN7JtxraCnU6F/NzBZq02dSRcZ13QSkmfYyyB DmZgQ/TjXs= Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 61AD1878D4; Sat, 12 Dec 2009 14:04:04 -0500 (EST) Received: from mappit (unknown [78.86.5.94]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 0A246878D3; Sat, 12 Dec 2009 14:04:02 -0500 (EST) Received: from brian by mappit with local (Exim 4.69) (envelope-from ) id 1NJXG5-0003rN-3g; Sat, 12 Dec 2009 19:04:01 +0000 Date: Sat, 12 Dec 2009 19:04:01 +0000 From: Brian Candler To: Leo Simons Cc: user@couchdb.apache.org Subject: Re: sum function in reduce with precision problems? Message-ID: <20091212190401.GA14795@uk.tiscali.com> Mail-Followup-To: Leo Simons , user@couchdb.apache.org References: <4B239831.1050402@leosimons.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B239831.1050402@leosimons.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Pobox-Relay-ID: 1DA79988-E751-11DE-99E9-DC0DEE7EF46B-28021239!a-pb-sasl-quonix.pobox.com On Sat, Dec 12, 2009 at 01:18:41PM +0000, Leo Simons wrote: > Looks like you're representing money; just work with cents (stored as > ints) and you will *probably* be fine, especially if you stay clear of > divisions. I wouldn't try and implement my own finance package that way, > though :) > > Alternatively, implement your own decimal type in javascript, or use a > relational database :) Or store strings (and deal with them with your client's BigDecimal or equivalent)