Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100531 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49291 invoked from network); 11 Sep 2017 23:11:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Sep 2017 23:11:44 -0000 Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.17.21 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.17.21 mout.gmx.net Received: from [212.227.17.21] ([212.227.17.21:55232] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 29/2D-10715-F2817B95 for ; Mon, 11 Sep 2017 19:11:43 -0400 Received: from [192.168.2.106] ([79.243.117.113]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MIPhr-1droqS2COV-004Dm8; Tue, 12 Sep 2017 01:11:39 +0200 To: Sara Golemon Cc: "internals@lists.php.net" References: Message-ID: Date: Tue, 12 Sep 2017 01:11:41 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:aWsi76Je+y9LoyFR53HYfCUaoey65XXLC7wJQy2tEurqJiqcnr8 9aUOchfsGLMZtsUcsExIDgEFlewQYZBqJik5Q3HQAYDniqb9BxJn0tj6XkGdixorbhi5ex/ Q5pTJdgCMtjWNwcG8X5lVAsGP3QrIvmQZIgO8uCYBUiPAmieTRovGjhZte3VGwhIrk1UzdQ 7tXYkE67NDvhq3ZFoAhJA== X-UI-Out-Filterresults: notjunk:1;V01:K0:QrL0k+Kke9E=:5zlTG9YWnKFwAVRJRmitLT r4x1qcvxGsKO17dFYJeULl6s+eHFCrwbkymziDbs9aKRnGHc4003eHSWdlxiwpfBUOqtZv0QZ AHvm927w+9i30+YI1N+Bba7I/PLVBwhhiY1FArY0P4Y+Bti7mLt8rrGJszkucDKRuhlMTRJ3R PNoUtwLoLiqcoOm0Yr4EfktEYlnBwXYPfzdgWm9CWQIQmtdnl98URkylBoTUn2OQ+przh5jzN CTBO3ZPdqtthxqFrRuWuLreJ5VgwxIiUXnalhHuaF0jkKOGFFc9EbyARh8N8Rd416up5I7i0a NTGBNzDCrq3a9WGyTsgIAc2zwZymvE7209LZXuQC1MNOOSD0mX525bpoAd7e3Eeqwr7Rt81JR ufPN1EEVkKrRPdn7DtpK3H73ICSPdjarUaizFQH/le64MBeTLODNIzC5TX4H+ukihEuiGnIdF vp5qZ/KqAdW3MyFU2UdAt6fBejVO1MnQGSafjvDppX6CzREC3/FWKSL+oCwM4l4KrSNPm28Ta 7UlAWZMi2dijsHojaEsG0Tkerqsp8SmTDW05Yka51ouzbSd7J6w1qWn5aVvRflzxNio4mFdb5 CRu7S6HO6hhjLeb5r4aVgDsQSlOB5u4VuhCFC+EXf1tCJQ8bvm47ccBMtJV6EZd35L3gyXeIT LjDT9FrJxC7OKdUW5QgT38Gu2SQMwm0/Nle+pYCkgiVfJyrV2NFGUQNlpy7LiRMwsj+8ASx+1 Hbt4xim15e3uTfCrefsdgTDRMvzBqk4ng8RuVNrpbcbb1wqL7Kq39lmQEpInTYq59vHwMJriI oIbJ36UkfDe4oRRNMFtFeLES/QzB1AYMqCl0+9Qovk66t9S2sU= Subject: Re: [PHP-DEV] BCMath and floats From: cmbecker69@gmx.de ("Christoph M. Becker") On 11.09.2017 at 19:13, Sara Golemon wrote: > On Mon, Sep 11, 2017 at 8:36 AM, Christoph M. Becker wrote: >> I already have proposed to introduce bcinit() which would take a string, >> int or float, and return a properly formatted string with the given or >> default scale, see . Nikita >> suggested to accept the arguments allowed by `bcinit()` for all >> functions in the first place. This would, however, raise the question >> which scale should be applied to floats. > > I agree with Nikita. Given that current behavior for floats passed to > bc*() obey EG(precision), I'd say we should retain that behavior in > these explicit conversions. That way existing (functional) uses > aren't impacted, we just quietly start working on other cases (where > scientific notation and/or non-period delimiters would have been > used). Okay, that makes sense. >> Before proceeding to an RFC (if necessary at all), I'm looking forward >> to hear your thoughts regarding this topic. >> > IMO, this falls under fixing an existing bug (bc*() functions don't > accept certain types of floats), so it wouldn't need an RFC to be > accepted. I would wait a little bit to get feedback on the scale > question before merging though. I would even offer that we could > apply this to 7.[012] safely. Hmm, the bc*() functions are documented to accept strings, and as such there is no actual bug; see also Mike's final assessment on . If we would consider this as bug, we also had to consider some other cases regarding our peculiar float to string casting behavior as bug. And even if we would, we still couldn't generally change the float to string cast for BC reasons easily (if ever). Anyhow, I'll gladly wait for further comments. :) -- Christoph M. Becker