Re: [RFC] [DISCUSSION] More precise float value
| From: | Jakub Zelenka | Date: | Mon, 30 May 2016 16:34:10 +0000 |
| Subject: | Re: [RFC] [DISCUSSION] More precise float value | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93634@lists.php.net to get a copy of this message | ||
On Fri, Sep 4, 2015 at 1:41 AM, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote:
> Hi all,
>
> IEEE 754 double cannot express exact float values. That said,
> float values expressed by json/serialize/var_export/echo/print
> are not precise enough in many cases.
>
> Issues:
> - json_encode() uses EG(precision)=14 that truncates float values.
> echo()/print()
> does this as well.
> - large EG(precision)/PG(serialize_precision) prints meaningless values.
>
> This RFC proposes zend_dtoa()'s 0 mode support which rounds float value
> to nearest value.
>
> https://wiki.php.net/rfc/precise_float_value
> https://github.com/php/php-src/pull/1455
>
> This change is simple enough for PHP 7.0. IMO.
> Comments/suggestions are appreciated!
>
>
Hi,
After asking Yasuo, I'm putting forward this RFC to have more precise float
to string decoding at least in PHP 7.1. I cleaned the RFC up a little bit
and it's targeting just 7.1.
It has been some time since this was announced so I will keep it open for a
week or two and then plan to start vote.
Cheers
Jakub