Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43794 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72587 invoked from network); 29 Apr 2009 04:09:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Apr 2009 04:09:52 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.200.174 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.200.174 wf-out-1314.google.com Received: from [209.85.200.174] ([209.85.200.174:9169] helo=wf-out-1314.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 50/2C-21632-E03D7F94 for ; Wed, 29 Apr 2009 00:09:51 -0400 Received: by wf-out-1314.google.com with SMTP id 28so629542wfc.26 for ; Tue, 28 Apr 2009 21:09:48 -0700 (PDT) Received: by 10.142.70.16 with SMTP id s16mr1705700wfa.336.1240978187374; Tue, 28 Apr 2009 21:09:47 -0700 (PDT) Received: from ?216.145.54.158? (socks1.corp.yahoo.com [216.145.54.158]) by mx.google.com with ESMTPS id 29sm1519771wfg.8.2009.04.28.21.09.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 28 Apr 2009 21:09:46 -0700 (PDT) Message-ID: <49F7D308.10708@lerdorf.com> Date: Tue, 28 Apr 2009 21:09:44 -0700 User-Agent: Thunderbird 2.0.0.18 (Macintosh/20081105) MIME-Version: 1.0 To: PHP Developers Mailing List X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Fixing arbitrary 40 digit max precision in printf code From: rasmus@lerdorf.com (Rasmus Lerdorf) Prompted by http://www.exploringbinary.com/print-precision-of-dyadic-fractions-varies-by-language/ I agree with the author that 40 is a weird arbitrary limit to impose here. As he writes, the smallest float that will fit in a double is 1074 decimal digits and the largest is 53. I don't see a reason we shouldn't be in line with Perl and C here. It's a couple of minor constant size changes in main/snprintf and ext/standard/formatted_print.c plus a test case fix. -Rasmus