Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75679 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41137 invoked from network); 18 Jul 2014 03:39:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jul 2014 03:39:15 -0000 Authentication-Results: pb1.pair.com smtp.mail=tjerk.meesters@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tjerk.meesters@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.180 as permitted sender) X-PHP-List-Original-Sender: tjerk.meesters@gmail.com X-Host-Fingerprint: 209.85.220.180 mail-vc0-f180.google.com Received: from [209.85.220.180] ([209.85.220.180:53159] helo=mail-vc0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E0/C1-31967-2E698C35 for ; Thu, 17 Jul 2014 23:39:14 -0400 Received: by mail-vc0-f180.google.com with SMTP id ij19so6338103vcb.11 for ; Thu, 17 Jul 2014 20:39:12 -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=iPy0zOn1RbgapqBQcN8eDaTwsXR/gjfBPMtb8aj1MkQ=; b=eyiPOy8n8/8oyxYd3G39RLv6UxE5TRCktDIoAP9TTRa0lln72FBxrXYFdQOeU2DrEW Q6z8JN0CrFCnGLVoD20aQ+/tx7VeqcduakIx5JRejH5fIALVeqRi9JMW0nOd85CFBigK AWF9qvOtaH3ymvod1pDl6ZSO2iaSvCFEOJbnYkI3bKBnssbM3eE4vOgtkpC1FuHoYWHl JYLo5cP7qUohfFGe3TocKdX5luud8fHzG1OMEBezPz7JaUHQnoTJiXqKrew5alwtTauT MUy5sDjnE00rvr/H27K/XHAKX19rMIe8J7DYV6XxweyZO6wkFLE4XDOGE6ImnQYr/Hde x2DQ== MIME-Version: 1.0 X-Received: by 10.52.98.201 with SMTP id ek9mr1241390vdb.35.1405654752127; Thu, 17 Jul 2014 20:39:12 -0700 (PDT) Received: by 10.58.89.170 with HTTP; Thu, 17 Jul 2014 20:39:11 -0700 (PDT) In-Reply-To: References: <7646A8D1-69A2-4255-B048-D3B9F28B422F@ajf.me> <37F89E54-C5B9-4E81-9D1B-660190BDB1FF@ajf.me> Date: Fri, 18 Jul 2014 11:39:11 +0800 Message-ID: To: Kris Craig Cc: Andrea Faulds , Nikita Popov , Sara Golemon , bishop@php.net, PHP internals Content-Type: multipart/alternative; boundary=20cf307ca2c22d742d04fe6f8075 Subject: Re: [PHP-DEV] [RFC] intdiv() From: tjerk.meesters@gmail.com (Tjerk Meesters) --20cf307ca2c22d742d04fe6f8075 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, Jul 18, 2014 at 10:47 AM, Kris Craig wrote: > 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 > divide > > > exactly and you need round-down/truncation behavior and your numbers > are > > 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= terms of > > floats. > > > > I mean, you can implement a right shift (rarely used outside bit masks) > in > > terms of multiplication and exponentiation, but that doesn=E2=80=99t me= an 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, ho= w > should it be implemented?" vote with the various options (the operators, > functions, etc). If the RFC passes, then whichever option got a pluralit= y > of the votes would be the implemented option. > This makes it more complicated because a language change requires 2/3 majority while a new function requires 50% + 1. To make things simpler - and I believe it had been proposed before - the main vote should include the implementation as a function and the secondary vote should be for the operator. > > So yeah, I'd say bring it to a vote and that'll settle it one way or > another. > > --Kris > --=20 -- Tjerk --20cf307ca2c22d742d04fe6f8075--