Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75678 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32649 invoked from network); 18 Jul 2014 02:47:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jul 2014 02:47:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=kris.craig@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kris.craig@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.51 as permitted sender) X-PHP-List-Original-Sender: kris.craig@gmail.com X-Host-Fingerprint: 209.85.219.51 mail-oa0-f51.google.com Received: from [209.85.219.51] ([209.85.219.51:51970] helo=mail-oa0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 08/00-31967-1DA88C35 for ; Thu, 17 Jul 2014 22:47:45 -0400 Received: by mail-oa0-f51.google.com with SMTP id o6so2169285oag.24 for ; Thu, 17 Jul 2014 19:47:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=/ZX6096o+jQrkF0HE9cO8BFz47z7DxIGxsJd1HEII70=; b=s+lrSDlhOPH/0/07doUFoyU4s+cboZMpA6SmmgsKQAs+i4ceepWeT5KIJcNCHd24cR 1NFk/ctHFaOUR2oPg5YXd+GwNZPQThmUih9sBaMEWIHengrjsZMuhvZ0QC7Yvb71xVXx n9V+o2/Ye4azQ68OoVD0uStSvzWxXtskvSD9UdwPO0ZIg5rHYjPJumUZDbRqqiAfim3G HPqh1mTsAfwlVE0SNRCn9OopC+D0eQYCQzoeVQmNwlrVafdsp5I0rA8Pl17sb6JuGayz Nfn/TZFnKH1mSxJa3gZ3yPFwi7jFJVjwWGsI04A3/hrr97QFVFnsTf9Gt0Z9tBWcpmGP V+5Q== MIME-Version: 1.0 X-Received: by 10.182.87.9 with SMTP id t9mr1790930obz.72.1405651662530; Thu, 17 Jul 2014 19:47:42 -0700 (PDT) Received: by 10.202.15.72 with HTTP; Thu, 17 Jul 2014 19:47:42 -0700 (PDT) In-Reply-To: References: <7646A8D1-69A2-4255-B048-D3B9F28B422F@ajf.me> <37F89E54-C5B9-4E81-9D1B-660190BDB1FF@ajf.me> Date: Thu, 17 Jul 2014 19:47:42 -0700 Message-ID: To: Andrea Faulds Cc: Nikita Popov , Sara Golemon , bishop@php.net, PHP internals Content-Type: multipart/alternative; boundary=089e013cb9ae05ed8604fe6ec8e2 Subject: Re: [PHP-DEV] [RFC] intdiv() From: kris.craig@gmail.com (Kris Craig) --089e013cb9ae05ed8604fe6ec8e2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, Jul 17, 2014 at 6:31 AM, Andrea Faulds wrote: > > On 17 Jul 2014, at 10:24, Nikita Popov wrote: > > > This is already what is currently happening, see > > http://lxr.php.net/xref/PHP_TRUNK/Zend/zend_operators.c#1067. > > > > Andreas proposal is only useful in the case that the numbers don't divi= de > > exactly and you need round-down/truncation behavior and your numbers ar= e > in > > a range where the indirection through double arithmetic results in > > precision loss. > > It=E2=80=99s still useful regardless as it saves you implementing it in t= erms of > floats. > > I mean, you can implement a right shift (rarely used outside bit masks) i= n > terms of multiplication and exponentiation, but that doesn=E2=80=99t mean= you > shouldn=E2=80=99t have a right shift. > > -- > Andrea Faulds > http://ajf.me/ > > > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > There seems to be a pretty even split on this. Personally, I'm a +1 for it. PHP has tons of obscure, rarely used functions. Even if the gain is relatively minor, there's really no cost that I can think of. So from a cost-benefit standpoint, even a minor improvement is still desirable when there's no practical downside to it. Given the number of options that are coming up, I'd suggest you break the RFC down into two votes: A simple yes/no vote followed by an "if yes, how should it be implemented?" vote with the various options (the operators, functions, etc). If the RFC passes, then whichever option got a plurality of the votes would be the implemented option. So yeah, I'd say bring it to a vote and that'll settle it one way or another. --Kris --089e013cb9ae05ed8604fe6ec8e2--