On Mon, 30 Jul 2001 22:13:32 +0200, I wrote:
> Because decbin is limited to 31 bit values, I thought that the gmp
> extension might be expanded a bit: If you add an optional base argument
> to gmp, then we actually have a <large number>-bit decbin. I think that
> would be nice.
[...]

I have received no comments about the above. The patch in question is
also at:
http://troels.arvin.dk/php-patches/gmp/gmp_init-with_base.patch.txt

The idea is that gmp_init() may be called with an optional extra
argument used to indicate the number base when interpreting strings.
This means that one may now feed gmp long binary values (which is
currently not possible without ugly hacks):
gmp_init('1010101010101010101010101010101010101010',2);

Does the lack of comments mean that I may commit the patch? (I think
that I still have CVS access.)

By the way:
I think that the decbin() function should bail out if you pass it a
value which contains more bits than PHP is able to handle. - Perhaps
with a hint about using GMP for large numbers.

-- 
Greetings from Troels Arvin, Copenhagen, Denmark

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to