Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88359 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22842 invoked from network); 18 Sep 2015 21:29:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Sep 2015 21:29:10 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.178 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.160.178 mail-yk0-f178.google.com Received: from [209.85.160.178] ([209.85.160.178:34042] helo=mail-yk0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/52-09127-4228CF55 for ; Fri, 18 Sep 2015 17:29:09 -0400 Received: by ykdg206 with SMTP id g206so58417373ykd.1 for ; Fri, 18 Sep 2015 14:29:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=rnuoUVV6itjB4sI6ZNriQuMiDn1KsxWWI0o3m9eDY24=; b=u4IrTsV9GQ4rhy6nu1h1sB0aTm0XELePdsaROmPkLnG/qeU3JU0E2HO8oAY/4+QUwo qosFPMlMfJ8Ysg4CyHXjPKUHN/Ko46I/nwpnLhFMBLdQ8shhZTP/4ZbR8m+Vw+VEzFUH ClWZoIW1DKqXygiZfso2Ngcx1VB5hZLokXcdUBcJnjigHDI8TObTtoL8kUvWD+WtkB/L Xd6DIGh6cmibD6dEN/LzS6G83ClBNep8rRHC0sRD0ujnt5f+3iqpif+mmDm7UsYyhQfG YjYeJflpQ4Zdb4DANmi39/84AL3JJ1ZFvmwt8+xA1L70sC96ALPKMtn+Q7H/NXR4Es4H pJyA== X-Received: by 10.13.210.5 with SMTP id u5mr6807005ywd.154.1442611745598; Fri, 18 Sep 2015 14:29:05 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.129.57.215 with HTTP; Fri, 18 Sep 2015 14:28:26 -0700 (PDT) In-Reply-To: References: Date: Sat, 19 Sep 2015 06:28:26 +0900 X-Google-Sender-Auth: Q9beqGcZd40ExTD3-I2WAYE-bck Message-ID: To: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [RFC] [DISCUSSION] More precise float value From: yohgaki@ohgaki.net (Yasuo Ohgaki) Hi all, On Fri, Sep 4, 2015 at 9:41 AM, Yasuo Ohgaki wrote: > 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! It's been 2 weeks and no comment for this. I'll start voting. Thanks. -- Yasuo Ohgaki yohgaki@ohgaki.net