Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75651 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36849 invoked from network); 17 Jul 2014 07:09:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jul 2014 07:09:03 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.207 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.207 imap2-2.ox.privateemail.com Received: from [192.64.116.207] ([192.64.116.207:33950] helo=imap2-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DC/95-09067-D8677C35 for ; Thu, 17 Jul 2014 03:09:02 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id DCDCD8C0080; Thu, 17 Jul 2014 03:08:58 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap2.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap2.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 7ovj8_GaJD5F; Thu, 17 Jul 2014 03:08:58 -0400 (EDT) Received: from [192.168.0.15] (unknown [90.210.122.167]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 423D18C007D; Thu, 17 Jul 2014 03:08:56 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: <6cb98adf7a217db7530122c98d2f7d02@mail.gmail.com> Date: Thu, 17 Jul 2014 08:08:53 +0100 Cc: bishop@php.net, PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: <28924D84-6571-4AD3-B541-9A2141BBEFCD@ajf.me> References: <7646A8D1-69A2-4255-B048-D3B9F28B422F@ajf.me> <37F89E54-C5B9-4E81-9D1B-660190BDB1FF@ajf.me> <9F08728B-AF74-4098-8D1D-BC21AB821168@ajf.me> <6cb98adf7a217db7530122c98d2f7d02@mail.gmail.com> To: Zeev Suraski X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] [RFC] intdiv() From: ajf@ajf.me (Andrea Faulds) On 17 Jul 2014, at 08:02, Zeev Suraski wrote: > I think it is, given I believe it's the first time people are asking = for > this after PHP's been out for almost two decades... > As the RFC itself suggests, you can use the current division for most = use > cases, including the ones mentioned above - they'd work in the vast > majority of cases. Yes, but as previously mentioned, beyond 2^52 it breaks down. What=92s = more worrying is the code out there written by people obviously unaware = of this, but I shouldn=92t use MtGox=92s incompetence as a reason to fix = PHP ;) > I think the RFC should mention that it's already possible to do it = using > bcmath or gmp; It=92s not possible to do with bcmath or gmp within the brief of =93find = the quotient of the division of two longs without requiring an = extension=94. Neither bcmath nor gmp is core PHP, and neither operate on = longs, though you can be silly and convert a long to a string, in = bcmath=92s case, or a gmp object, in gmp=92s case, then do the = operation, then convert back, checking for the two failure cases, of = course. > That said, I tend to agree that we should have something > like that in ext/standard, so I'm actually in favor of doing it - just = not > as an operator. Well, that=92s better than nothing I suppose, but I=92d still rather use = something infix. > To be honest, that operator was simply copied verbatim from Perl, back = in > the day when Perl ruled the Web world and minimizing the learning = curve > for Perl developers was an important goal. Not sure if we'd add it to = the > language had we not 'plagiarized' it from Perl=85 Huh? ** was added by an RFC this year. Actually, since 5.6 isn=92t out = yet, it=92s technically not part of PHP yet... -- Andrea Faulds http://ajf.me/