Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:11507 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30811 invoked by uid 1010); 23 Jul 2004 10:55:32 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 30755 invoked by uid 1007); 23 Jul 2004 10:55:32 -0000 Message-ID: <20040723105532.30754.qmail@pb1.pair.com> To: internals@lists.php.net Date: Fri, 23 Jul 2004 17:12:38 +0300 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 References: <20040723080319.74978.qmail@pb1.pair.com> <4100DB8A.2000003@cschneid.com> In-Reply-To: <4100DB8A.2000003@cschneid.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 80.221.251.197 Subject: Re: fp, rounding, decimal arithmetic - definitive account? From: george@ishop.co.uk (George Whiffen) Christian Schneider wrote: > George Whiffen wrote: > >> As you either already know or could reasonably guess, my personal >> view is that simple, consistent, exact decimal arithmetic is highly >> desirable for any development tool intended for either >> novices or commercial use. > > > I use BCMath for critical (e.g. money) calculations as I'd never trust > floating point, with or without your fixes. Especially since I'm dealing > with big numbers. > > - Chris Chris, Exactly my point. When coding php you need floating point you can trust or it is useless. As I said, bc is probably the best currently available approach. Presumably you trust bc because either you've checked the code yourself or you trust the guys who wrote it and say it works. So what we need with my fixes is for you to check the code/theory yourself or to have someone you trust to do it for you. So, who would you trust? If I'm wrong, and it's really only bc that can be trusted to add 0.1 and 0.1, then shouldn't we be using that internally, rather than pretending to have a useable fp decimal arithmetic? George P.S. I'm interested that you have money numbers so big that 15 digits are not enough. It can't be gross world income which still isn't up to $1e15 and certainly is never quoted to the dollar. I can only guess that it's global currency market volumes you are handling. Do they really quote them to the dollar?