Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87379 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48427 invoked from network); 29 Jul 2015 23:26:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jul 2015 23:26:24 -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.173 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.160.173 mail-yk0-f173.google.com Received: from [209.85.160.173] ([209.85.160.173:33624] helo=mail-yk0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AD/23-25901-F1169B55 for ; Wed, 29 Jul 2015 19:26:23 -0400 Received: by ykba194 with SMTP id a194so21371846ykb.0 for ; Wed, 29 Jul 2015 16:26:21 -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:cc:content-type; bh=6Co+szMALlyHlAbpJa78moCUl7cbc3MUMvUAdyox4Pc=; b=wr3YnDssnkF3i7d1PQZmrLpCB6PHzNbi4bMn67AFMEM6eWzCga/Tj9/KusgpyV9dQk iMwysBBMupBkZIZqOlfgirqAS/OXw+mi+8RN1ZL4Id9ydjM/GUJGzmlnvSGrtmruoZUR n8BtYfRU3yicRV/FVBzk1NVRX1CSsyVyb0i/zeJhrKMEFMVDgiIh/PqbzrGPHHRU6bBU vdxSIzaCk588J+a1+3BVvua3FOlUpYMBGxZAeDx8PBZQ/SYgMCgwCye0u9AkVrZpRHyA 1ruasIYgRW+gAEEpU1wgxJr0z2WiEKChdon0Yx5Dtj5ooCOH0k4HAVlmbYDA43nufLE1 VNKw== X-Received: by 10.170.35.74 with SMTP id 71mr47831145ykd.35.1438212380965; Wed, 29 Jul 2015 16:26:20 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.129.40.77 with HTTP; Wed, 29 Jul 2015 16:25:41 -0700 (PDT) In-Reply-To: References: Date: Thu, 30 Jul 2015 08:25:41 +0900 X-Google-Sender-Auth: PvAbesE8xHWL9_IHZBVOkn37Oh4 Message-ID: To: Nikita Popov Cc: Jakub Zelenka , Anthony Ferrara , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a1137bb8c14423d051c0bea81 Subject: Re: [PHP-DEV] json_decode/encode should return full precision values by default From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a1137bb8c14423d051c0bea81 Content-Type: text/plain; charset=UTF-8 Hi all, On Thu, Jul 30, 2015 at 7:44 AM, Yasuo Ohgaki wrote: > On Thu, Jul 30, 2015 at 1:13 AM, Nikita Popov > wrote: > >> Instead of continuing to use serialize_precision, which will produce >> unnecessarily long outputs for many values, why don't we just switch to >> using the 0 mode of zend_dtoa, i.e. to return the shortest output that is >> still accurate if interpreted in round-to-nearest. I think this is what >> everybody else is using when they convert floating point numbers to >> strings. I guess we may not be able to change normal floating point >> printing to use this, but this seems like the best mode for anything using >> serialize_precision now and everything that should be using it (like JSON, >> and queries, etc). > > > I prefer your proposal! > Your proposal is a lot better than now. > Anyone has opinion for this? > > I'm writing the RFC and I would like to make this the first option. i.e. > serialize_precision=0 uses "zend_dtoa 0 mode" for all data exchange > functions (json/serialize/var_exrport. Anyone care about WDDX/XML_RPC?) > I wrote draft RFC. https://wiki.php.net/rfc/precise_float_value Please comment. I would like to start RFC discussion shortly. Thank you. -- Yasuo Ohgaki yohgaki@ohgaki.net --001a1137bb8c14423d051c0bea81--