Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75537 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57219 invoked from network); 15 Jul 2014 12:20:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jul 2014 12:20:21 -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.216 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.216 imap10-3.ox.privateemail.com Received: from [192.64.116.216] ([192.64.116.216:48188] helo=imap10-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 45/AB-15121-48C15C35 for ; Tue, 15 Jul 2014 08:20:21 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 2F2012400D4; Tue, 15 Jul 2014 08:20:18 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap10.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap10.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id idg3RwCJh4MH; Tue, 15 Jul 2014 08:20:18 -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 4ACDF2400DC; Tue, 15 Jul 2014 08:20:16 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: <53C4B955.5060401@sugarcrm.com> Date: Tue, 15 Jul 2014 13:20:12 +0100 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: References: <7646A8D1-69A2-4255-B048-D3B9F28B422F@ajf.me> <53C47CA2.4050306@sugarcrm.com> <714C2E5E-A321-4993-9CFB-F7DFAC45C532@ajf.me> <53C4B955.5060401@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 06:17, Stas Malyshev wrote: > Why not? bcmath is in core since forever and has no external > requirements, gmp builds practically everywhere too. AFAIR all distros > have it. Partly practicality, partly principle. A barebones installation of PHP = may not include gmp or bcmath. If my bigint RFC got in, it would have to = include the former, but that is a possible future and not the present = reality. I should point out that while, yes, bcmath could be used here, it is not = efficient to do it by string manipulation (this is a type *natively = supported* by literally every semi-modern processor and an operation = built into C!). Also, gmp does the wrong thing, as will give you a gmp = number result, whereas what I want is an integer. To use gmp is just as = hackish as doing a floating-point division and casting, as the values we = pass in would be converted to big integers, divided, then the resulting = big integer would need to be manually converted back to a long. It would make far more sense to simply support this basic, = widely-supported and somewhat common operation than to encourage = programmers to use poor workarounds which do not even work when a basic = PHP installation is used. -- Andrea Faulds http://ajf.me/