Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75631 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 689 invoked from network); 17 Jul 2014 03:23:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jul 2014 03:23:49 -0000 Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.192.180 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.192.180 mail-pd0-f180.google.com Received: from [209.85.192.180] ([209.85.192.180:37380] helo=mail-pd0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A5/12-19007-2C147C35 for ; Wed, 16 Jul 2014 23:23:47 -0400 Received: by mail-pd0-f180.google.com with SMTP id y13so2316004pdi.11 for ; Wed, 16 Jul 2014 20:23:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=ERDm0/UiuT26azDoMi6OvSLfgaCKh3hN5xcg+zDwRuk=; b=FSPBF/tVfjB/L6JWtQ8fM0qAjeH9iyZpwGq8EFNKqsyWU/y6Ps0/26xBoGqsjX7NqZ CnktY2lbcG6nrFjCqItYpuf5hgGE0A9J4BtESgqAgsdnDdGjd7Pu2fvkigsU2jU/tKTb epbxIpsmTrozCe7Jz79z3ytuwlmqwCO2pdhC4EScjz7J82VNqJxys/aagdBmBlDEFwaz E/OR/CYrR4lvDScL9mqsAGEG4K64NN56kSqhr7fm6jK5AKOT+2gkCwUA6iSv/6O5rseL tMU7ZDu7hJQesyu3mHJXEvYnITqCfzUzMRjHFVhpr6R1zIhCGvAmNEOHGXiBvRfBBk61 cNhA== X-Gm-Message-State: ALoCoQkLfLmMFwrA0hQHJyqf27h/3oyVuIhRieuZD9RacF63yq93iZXZbLn1/XXml7OgkEI4UEyt MIME-Version: 1.0 X-Received: by 10.68.106.194 with SMTP id gw2mr34019763pbb.85.1405567423663; Wed, 16 Jul 2014 20:23:43 -0700 (PDT) Sender: php@golemon.com Received: by 10.70.21.35 with HTTP; Wed, 16 Jul 2014 20:23:43 -0700 (PDT) X-Originating-IP: [71.198.113.183] In-Reply-To: <1240076591.91249.1405564441970.open-xchange@app1.ox.registrar-servers.com> References: <1240076591.91249.1405564441970.open-xchange@app1.ox.registrar-servers.com> Date: Wed, 16 Jul 2014 20:23:43 -0700 X-Google-Sender-Auth: GdyFnFjaUIvPWH_fkneRBH6LnlM Message-ID: To: Andrea Faulds Cc: Tjerk Meesters , bishop@php.net, PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] intdiv() From: pollita@php.net (Sara Golemon) On Wed, Jul 16, 2014 at 7:34 PM, Andrea Faulds wrote: > What are you suggesting you do for an integer division, then? ($a - ($a % $b)) / > $ b? The division operator already returns an integer. Or should I just use > intdiv()? > Wow. I just finally understood what your RFC was going for. I thought you were trying to cover the case where ($a%$b)==0, but you're not, you're trying to do truncated integer division regardless of remainder. I also missed the fact that div_function does the right thing already as well. My bad for emailing from the bus. Okay, that's another animal entirely. Do we need a new operator for that? It feels un-php to me, and the kind of problem bigint objects should be meant to solve. On the other hand, having $a/$b != $a/$b (Off by more than 100 in this instance). But back on the first hand, that's consistent with other operations on large floats anyway. PHP_INT_MAX + 1 != One more than PHP_INT_MAX, for example. -Sara