Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75527 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23031 invoked from network); 15 Jul 2014 05:50:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jul 2014 05:50:52 -0000 Authentication-Results: pb1.pair.com header.from=kris.craig@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=kris.craig@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.181 as permitted sender) X-PHP-List-Original-Sender: kris.craig@gmail.com X-Host-Fingerprint: 209.85.214.181 mail-ob0-f181.google.com Received: from [209.85.214.181] ([209.85.214.181:61452] helo=mail-ob0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 10/86-15121-931C4C35 for ; Tue, 15 Jul 2014 01:50:51 -0400 Received: by mail-ob0-f181.google.com with SMTP id va2so3422820obc.12 for ; Mon, 14 Jul 2014 22:50:47 -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=jCpbUEij20QGGIulhPbh0s+6gWY6Uidj8HYlXzJICas=; b=DC6ZtB6Q/DtEhmcxFraZ+PinWfVI8QzehWD3XHCDGR1atvGgnPX4Pm+jaklAz6e1wC 3TIiVGDMLexN1IQLjIvTAgMCNCfhk8i9zI0/aSFHyaVOmP4xNBX0HgeqrbTVJXxksGpo tLFGG/T6rLHoq6kuuDPgSiIlfxhA/sFoqUN/IzXvLNQ3sXqr95qFxPhTOsNgH80B+h1x /Cup4ykMJF2x752d0CjbsffEG4LwlZeqGODD9uDKKa5dAQ6EISR/bhzWlozbb8mXU94m TB9GmmReJq/k92rVEJss25OPRTyyOv3nk/w/BJPvWdPZvKEpj9kVMfsBCIyLKb/Z99D5 Mmqw== MIME-Version: 1.0 X-Received: by 10.60.134.76 with SMTP id pi12mr12486613oeb.0.1405403447172; Mon, 14 Jul 2014 22:50:47 -0700 (PDT) Received: by 10.202.15.72 with HTTP; Mon, 14 Jul 2014 22:50:47 -0700 (PDT) In-Reply-To: <53C4B955.5060401@sugarcrm.com> References: <7646A8D1-69A2-4255-B048-D3B9F28B422F@ajf.me> <53C47CA2.4050306@sugarcrm.com> <714C2E5E-A321-4993-9CFB-F7DFAC45C532@ajf.me> <53C4B955.5060401@sugarcrm.com> Date: Mon, 14 Jul 2014 22:50:47 -0700 Message-ID: To: Stas Malyshev Cc: Andrea Faulds , PHP internals Content-Type: multipart/alternative; boundary=047d7b4720123c229904fe34fda2 Subject: Re: [PHP-DEV] [RFC] intdiv() From: kris.craig@gmail.com (Kris Craig) --047d7b4720123c229904fe34fda2 Content-Type: text/plain; charset=UTF-8 On Mon, Jul 14, 2014 at 10:17 PM, Stas Malyshev wrote: > Hi! > > > Both of those are likely not to be installed on most systems. Why do > > Why not? bcmath is in core since forever and has no external > requirements, gmp builds practically everywhere too. AFAIR all distros > have it. > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > While a practical argument can certainly be made that existing solutions can fit the examples OP cited, I don't think that takes away from the underlying principle of the argument: That there's no reason *not* to include a basic integer division in PHP. It's never made sense to me why it wasn't included. Rather than an intdiv() function, though, I wonder if an operator would be a better approach. Some languages I've seen that use / as the division operator will use a \ as the integer division operator. --Kris --047d7b4720123c229904fe34fda2--