Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75648 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32129 invoked from network); 17 Jul 2014 06:56:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jul 2014 06:56:23 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.170 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.216.170 mail-qc0-f170.google.com Received: from [209.85.216.170] ([209.85.216.170:58013] helo=mail-qc0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0C/94-09067-69377C35 for ; Thu, 17 Jul 2014 02:56:23 -0400 Received: by mail-qc0-f170.google.com with SMTP id c9so1757932qcz.15 for ; Wed, 16 Jul 2014 23:56:20 -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:content-transfer-encoding; bh=QWBH9w9lo4UjB8zfauGq4gKiOc8yJomglRjc6yM5L68=; b=r4lO89K8W6Mi4q+jS4tWBxxBjXvCd/X5fXaWB4qTl7c+hLIQNypmdv6aN64fli0yGE gFidqacW3h9+end47jD/dDZmS3KJPH8yPuObjP+FEnTIEf97QnilQAgKtDM2DxEkKVQn R73ZxO4kY8CB0qhWau516JCSF5PXyzsU8959H/eU3VuHX+oYenipHbQpx1eSb5jXVii5 n0pvVr2WYNJiPrGJ9IFhfgQ7w0np2infghLD1Xw54NYRGpVVe/OJP4AYnK39VEu8CmJv mJsXSw5tQS6WZ3+RVs9napdcE68UNHBei2OOZk/K4BFhudvOURwKi7vJyI0k97hG55+3 znQg== MIME-Version: 1.0 X-Received: by 10.140.105.72 with SMTP id b66mr3968965qgf.30.1405580180018; Wed, 16 Jul 2014 23:56:20 -0700 (PDT) Received: by 10.140.28.183 with HTTP; Wed, 16 Jul 2014 23:56:19 -0700 (PDT) In-Reply-To: <9F08728B-AF74-4098-8D1D-BC21AB821168@ajf.me> References: <7646A8D1-69A2-4255-B048-D3B9F28B422F@ajf.me> <37F89E54-C5B9-4E81-9D1B-660190BDB1FF@ajf.me> <9F08728B-AF74-4098-8D1D-BC21AB821168@ajf.me> Date: Thu, 17 Jul 2014 08:56:19 +0200 Message-ID: To: Andrea Faulds Cc: Zeev Suraski , bishop@php.net, PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] intdiv() From: pierre.php@gmail.com (Pierre Joye) Hi Andrea, On Thu, Jul 17, 2014 at 8:44 AM, Andrea Faulds wrote: > > On 17 Jul 2014, at 07:29, Zeev Suraski wrote: > >> From debating whether it's worth it to add a new function for an >> not-so-commonly-used-operation-to-say-the-least, we're now seriously >> considering adding a new language level operator? Really? > > Is it *really* not that common? I can think of several use-cases off the = top of my head: > > * Time (actually pretty common in web apps, though we have a DateTime cla= ss) > * Splitting into rows and columns > * Pagination > * Currency (you can=E2=80=99t, for example, represent the full number of = BTC in circulation in BTC's base unit without using an integer of beyond 53= -bits, and it=E2=80=99s common practise to use *fixed-point* arithmetic her= e) > * Nearest-neighbour scaling > * Most likely other ones (these are just what I thought of immediately) > > Also, while ** is great for some applications, it=E2=80=99s not going to = be used much by others. Is the same not true of an integer division operato= r? The rare cases where I had to do that, I relied on bcmath or gmp. Yes, I needed some extra ops to actually achieve what this RFC proposes but it is good enough. The new ops overloading for extension simplifies that a lot as well. I am sorry but I'd to say -1 on this addition, not worse a new operator or function for this. Cheers, --=20 Pierre @pierrejoye | http://www.libgd.org