Re: gmp_init with a base argument

From: Date: Thu, 02 Aug 2001 17:11:10 +0000
Subject: Re: gmp_init with a base argument
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-61847@lists.php.net to get a copy of this message
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

« previous php.dev (#61847) next »