RE: [PHP-DEV] Re: [RFC] [DISCUSSION] More precise float value

From: Date: Sat, 26 Sep 2015 19:31:58 +0000
Subject: RE: [PHP-DEV] Re: [RFC] [DISCUSSION] More precise float value
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-88520@lists.php.net to get a copy of this message
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. > > 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. > > Let me know if you have comments on this. > Thanks for retargeting the RFC. > > 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. > > "-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. > Exactly, so my question was - why it still needs to do "if (mode == 0) ndigit = 17;" in snprintf at the place I've linked? It won't have any effect as zend_dtoa will ignore it :) Regards Anatol

« previous php.internals (#88520) next »