Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88520 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38600 invoked from network); 26 Sep 2015 19:32:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Sep 2015 19:32:14 -0000 Authentication-Results: pb1.pair.com header.from=anatol.php@belski.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=anatol.php@belski.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain belski.net from 85.214.73.107 cause and error) X-PHP-List-Original-Sender: anatol.php@belski.net X-Host-Fingerprint: 85.214.73.107 klapt.com Received: from [85.214.73.107] ([85.214.73.107:57098] helo=h1123647.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C5/D3-06395-CB2F6065 for ; Sat, 26 Sep 2015 15:32:12 -0400 Received: by h1123647.serverkompetenz.net (Postfix, from userid 1006) id A13F96D2002; Sat, 26 Sep 2015 21:32:08 +0200 (CEST) Received: from w530phpdev (pD9FE87CD.dip0.t-ipconnect.de [217.254.135.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by h1123647.serverkompetenz.net (Postfix) with ESMTPSA id 4AAB86D2002; Sat, 26 Sep 2015 21:32:04 +0200 (CEST) To: "'Yasuo Ohgaki'" Cc: "'Kalle Sommer Nielsen'" , "'Ferenc Kovacs'" , References: <023701d0f4a4$a0da4f60$e28eee20$@belski.net> In-Reply-To: Date: Sat, 26 Sep 2015 21:31:58 +0200 Message-ID: <004701d0f892$05fdb0d0$11f91270$@belski.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQIuTDCwWc2HF4xophrruCZqRmQ9xAK8kBvIAb/EVTQDP8PfqgOVioFOAsDUwzqdI5wTkA== Content-Language: en-us Subject: RE: [PHP-DEV] Re: [RFC] [DISCUSSION] More precise float value From: anatol.php@belski.net ("Anatol Belski") Hi Yasuo, > > Thanks for the ping. IMHO this is the stuff for 7.1. I actually saw = the > discussions previously, but was rather thinking you was targeting 7.1 = as that was > already the time of the feature freeze. >=20 > No problem. I'll update so that 0 mode is for 7.1. > JSON's is better to use larger precision. So this change is targeted = to 5.6 and 7.0. >=20 > Let me know if you have comments on this. >=20 Thanks for retargeting the RFC. =20 > > BTW I also had a comment there in the PR about = https://github.com/php/php- > src/pull/1455/files#diff-c84859666ff690a113d55ef1899d8bf4R149 - so if = mode > 0 ignores ndigits, why set it to 17 (or anything else). Seems like an = unnecessary > action, but snprintf is used quite frequently. But just as a notice on = the side. >=20 > "-1" which is invalid precision is used to indicate 0 mode. > 0 mode is supposed to use max precision for double (it seems many > implementations use 16, but PHP uses 17), when 0 mode is used, it uses = 17 as > precision always. >=20 Exactly, so my question was - why it still needs to do "if (mode =3D=3D = 0) ndigit =3D 17;" in snprintf at the place I've linked? It won't have = any effect as zend_dtoa will ignore it :) Regards Anatol