On 15 Jul 2014, at 06:17, Stas Malyshev <smalys...@sugarcrm.com> 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/





--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to