Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51439 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5932 invoked from network); 9 Feb 2011 04:07:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Feb 2011 04:07:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=mail_ben_schmidt@yahoo.com.au; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=mail_ben_schmidt@yahoo.com.au; sender-id=unknown; domainkeys=good Received-SPF: error (pb1.pair.com: domain yahoo.com.au from 98.138.90.71 cause and error) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: mail_ben_schmidt@yahoo.com.au X-Host-Fingerprint: 98.138.90.71 nm8.bullet.mail.ne1.yahoo.com Received: from [98.138.90.71] ([98.138.90.71:43555] helo=nm8.bullet.mail.ne1.yahoo.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8A/AD-18268-413125D4 for ; Tue, 08 Feb 2011 23:07:49 -0500 Received: from [98.138.90.56] by nm8.bullet.mail.ne1.yahoo.com with NNFMP; 09 Feb 2011 04:07:46 -0000 Received: from [98.138.89.168] by tm9.bullet.mail.ne1.yahoo.com with NNFMP; 09 Feb 2011 04:07:46 -0000 Received: from [127.0.0.1] by omp1024.mail.ne1.yahoo.com with NNFMP; 09 Feb 2011 04:07:46 -0000 X-Yahoo-Newman-Id: 193447.86514.bm@omp1024.mail.ne1.yahoo.com Received: (qmail 20560 invoked from network); 9 Feb 2011 04:07:45 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.au; h=DKIM-Signature:Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=G8pK9+HldA25ubLNm5ewto/yRBxX1kpvgXq256Wimi47/8Yn3eQnJXn2au5r6uPPuTVmkf7QDflYvFtghfCmA0l7qw2rLCbsGRS3DiM3qag8ypCTrfroFRKK+IJMahg9XXWdEGj77iSBbYpTep+THZU+mrOgJWeZPc05hLYpanE= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.au; s=s1024; t=1297224465; bh=r3HNClClLA7sWn5+FB6u/V0fVbXz0eN/ceBGFEypZg4=; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=cE/rCXQ2Xl4nUwpCFcB4AQ40qFvWqPBRykMjOwJ2FC+91zP858KWCXeBmUWXqg2mDlC2PpvDsEGjHsjJgJoFQnUcg+MWoS2Xxz45PGriZ1Dki2F4HB1MzB/aQ+Op1M2zqhtdVQiKmYWoXioLBEg401FLOtm1l7qgDJugdQW2t6k= Received: from 194.20.70.115.static.exetel.com.au (mail_ben_schmidt@115.70.20.194 with plain) by smtp135.mail.mud.yahoo.com with SMTP; 08 Feb 2011 20:07:44 -0800 PST X-Yahoo-SMTP: enFMnPSswBAexaHyzgobwuUTrYOhZdJ0KRA2SjA- X-YMail-OSG: 6ZVRkZQVM1mg7Iv1tSJfWxgOUUvAbUaSoy_zPL8CvyOvR0y id7SLTmWfHslGyD.eW6xKK06IDgoeATdCE.mJpFiPKipUnkrngwj4t596igc wqWPmmNCcC01jXhlTe_VEEHL_paKn7DNE21gZAkOBnUnBtDI2lVFylALYNJ_ _nwex8AVNEZaDrpqMprvs9uh0zlZ7l32239MK2.0Qeudnn1sVMpVH1GfdfZh v_4nIVWAPn024qvaP7OcVMCYPEBf45NH13ZHx5CO500UY5aqm1cfpVFvK6x9 .DbOskH8LaqP.p4WC X-Yahoo-Newman-Property: ymail-3 Message-ID: <4D521309.80906@yahoo.com.au> Date: Wed, 09 Feb 2011 15:07:37 +1100 User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-GB; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 ThunderBrowse/3.3.4 MIME-Version: 1.0 To: Gustavo Lopes CC: internals@lists.php.net References: <843E1DDB7AB24D9FA8F05801FE45202A@pc> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Change default serialize precision from 100 to 17 From: mail_ben_schmidt@yahoo.com.au (Ben Schmidt) > Yes, I think it's dangerous to change the default display precision > lest we have a ton of applications that currently show 0.2 showing > 0.20000000000000001. Exactly. And remember, PHP output is not necessarily just for web pages for humans to read. Other apps may rely on parsing this data, etc., and may break if precision changes unexpectedly. >> Would it be possible to "displays a value based on the shortest >> decimal fraction that rounds correctly back to the true binary value", >> like python 2.7 and 3.1 do ? >> (http://docs.python.org/tutorial/floatingpoint.html) > > This may be a good idea for trunk, but I don't think it's feasible for > 5.3 for the same reason. Announced as part of a major or point upgrade, I guess this would be OK. But it still doesn't solve the core problem, which is that the display precision is being used where it shouldn't be used, e.g. for DB communications. > Showing "shortest decimal fraction that rounds correctly back to the > true binary value" works fine for numbers that are directly input, where the only > error is the normal rounding error (i.e., total uncertainty for x is x*2^-53). > Once you start making calculations with the numbers the errors start being > propagated, so in these scenarios you would still end up with a lot more "ugly" > string representations that you have today with the default display precision. Yeah. For this reason, I think it would be more of a nuisance for the average app than a help. A lower display precision is actually desirable. > I agree that the information loss in e.g. PDO must be fixed, but it > seems more appropriate to fix those problems by forcing another > precision only in those cases. A much better way to fix it. Ben.