Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:14704 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22672 invoked by uid 1010); 7 Feb 2005 21:20:33 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 22657 invoked from network); 7 Feb 2005 21:20:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Feb 2005 21:20:33 -0000 X-Host-Fingerprint: 62.134.147.34 mail.internet-factory.de Linux 2.4/2.6 Received: from ([62.134.147.34:40956] helo=mail.internet-factory.de) by pb1.pair.com (ecelerity HEAD (r4105:4106)) with SMTP id 32/D8-36585-D9BD7024 for ; Mon, 07 Feb 2005 16:20:30 -0500 Received: from pharao.lammfellpuschen.de (p508A695F.dip.t-dialin.net [80.138.105.95]) by mail.internet-factory.de (8.12.8/8.12.8) with SMTP id j17LK6hB003849; Mon, 7 Feb 2005 22:20:07 +0100 Received: by pharao.lammfellpuschen.de (sSMTP sendmail emulation); Tue, 8 Feb 2005 00:20:06 +0300 Date: Tue, 8 Feb 2005 00:20:06 +0300 To: Ron Korving Cc: internals@lists.php.net Message-ID: <20050207212006.GA6294@pharao.serveftp.org> Reply-To: messju mohr References: <20050207203954.52626.qmail@lists.php.net> <20050207204629.63824.qmail@lists.php.net> <20050207210519.2101.qmail@lists.php.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050207210519.2101.qmail@lists.php.net> User-Agent: Mutt/1.4.2.1i X-WebServ-IT-MailScanner-Information: Please contact the ISP for more information X-WebServ-IT-MailScanner: Found to be clean X-WebServ-IT-MailScanner-SpamCheck: not spam, SpamAssassin (score=1.376, required 5, AWL -0.06, BAYES_00 -4.90, RCVD_IN_DYNABLOCK 2.60, RCVD_IN_NJABL 0.10, RCVD_IN_NJABL_DIALUP 3.54, RCVD_IN_SORBS 0.10) X-WebServ-IT-MailScanner-SpamScore: s X-MailScanner-From: messju@lammfellpuschen.de Subject: Re: [PHP-DEV] Re: is the bankers' round() algorithm implemented well? From: messju@lammfellpuschen.de (messju mohr) On Mon, Feb 07, 2005 at 10:04:46PM +0100, Ron Korving wrote: > I just did a long test from 1 - 10000 and I noticed that every time the > number was increased with one bit (starting with 2048, then 4096, then 8192) > behaviour changes. You were right, my bad. > > Makes me wonder though, what's the point of a bankers' algorithm if .005 can > never be reached, only approached? :) This unpredictable rounding behaviour > is a real b*tch, but what can you do :) you want to use integers or bcmath (http://php.net/bc) or gmp (http://php.net/gmp) to get your own control of rounding and accuracy. this makes this thread more appropiate for php-general than for internals. greetings messju > Ron