Re: [RFC] intdiv()
| From: | Stas Malyshev | Date: | Thu, 17 Jul 2014 07:17:51 +0000 |
| Subject: | Re: [RFC] intdiv() | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-75652@lists.php.net to get a copy of this message | ||
Hi!
> * Time (actually pretty common in web apps, though we have a DateTime
> class)
Admittedly, we're getting closer to the dreaded year 2038, but what does
it actually mean to divide current Unix timestamp by 3 and why one would
ever want to do this? We also have classes for real datetime calculations.
> * Splitting into rows and columns
> * Pagination
Here you are onto something, but how often you paginate data sets of
MAXINT size and need exact number of pages?
> * Currency (you can’t, for example, represent the full number of BTC
> in circulation in BTC's base unit without using an integer of beyond
> 53-bits, and it’s common practise to use *fixed-point* arithmetic
> here)
If you're using ints for currency, you're probably doing it wrong. If
you're dividing currency using integer division, I don't even know what
you are trying to do, except reenacting Office Space :)
> * Nearest-neighbour scaling
You mean image processing? If 53 bit precision is not enough there, I'm
not even sure PHP should be doing that.
IMHO this is not enough for a new operator... Especially if this means
we have to tolerate something like %/.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/