Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75522 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3092 invoked from network); 15 Jul 2014 01:02:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jul 2014 01:02:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.200 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.200 imap1-2.ox.privateemail.com Received: from [192.64.116.200] ([192.64.116.200:34586] helo=imap1-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 84/E3-15121-6AD74C35 for ; Mon, 14 Jul 2014 21:02:30 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 8A0CCB00081; Mon, 14 Jul 2014 21:02:27 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap1.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap1.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id S1ieBnfkTQUd; Mon, 14 Jul 2014 21:02:27 -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 35080B0007B; Mon, 14 Jul 2014 21:02:25 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: <53C47CA2.4050306@sugarcrm.com> Date: Tue, 15 Jul 2014 02:02:21 +0100 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: <714C2E5E-A321-4993-9CFB-F7DFAC45C532@ajf.me> References: <7646A8D1-69A2-4255-B048-D3B9F28B422F@ajf.me> <53C47CA2.4050306@sugarcrm.com> To: Stas Malyshev X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] [RFC] intdiv() From: ajf@ajf.me (Andrea Faulds) On 15 Jul 2014, at 01:58, Stas Malyshev wrote: > INT_MAX is kind of an edge case, It=92s just an obvious example, integers beyond 2^53 fulfill this. > if you need arbitrary-length precision > you can always use gmp or bcmath. I=92m not asking for arbitrary-length precision, I=92m asking for an = integer division operator for PHP=92s integer type. Granted, this = function would be even more useful if my bigints RFC got in, but it=92s = useful now. > I'm not sure this one-off use case > that is already covered by two extensions really needs another = function. Both of those are likely not to be installed on most systems. Why do you = need to install gmp or bcmath to do a basic operation with two 64-bit = integers yielding a 64-bit integer? Many languages support this (C, C++, = C#, Java, Python, to name a few). Why shouldn=92t PHP? > Practically, where would you need exact division up to 53 bits but not > beyond? No idea. This RFC isn=92t proposing that. -- Andrea Faulds http://ajf.me/