Re: [RFC] intdiv()
| From: | Andrea Faulds | Date: | Tue, 15 Jul 2014 01:02:21 +0000 |
| Subject: | Re: [RFC] intdiv() | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-75522@lists.php.net to get a copy of this message | ||
On 15 Jul 2014, at 01:58, Stas Malyshev <smalyshev@sugarcrm.com> wrote:
> INT_MAX is kind of an edge case,
It’s just an obvious example, integers beyond 2^53 fulfill this.
> if you need arbitrary-length precision
> you can always use gmp or bcmath.
I’m not asking for arbitrary-length precision, I’m asking for an integer division operator for
PHP’s integer type. Granted, this function would be even more useful if my bigints RFC got in, but
it’s 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’t PHP?
> Practically, where would you need exact division up to 53 bits but not
> beyond?
No idea. This RFC isn’t proposing that.
--
Andrea Faulds
http://ajf.me/