mpz_tstbit is limited ?

delta trinity deltatrinity@hotmail.com
Wed, 25 Dec 2002 12:12:00 -0500


>  Hi,
>
>The definition of the mpz_tstbit function is:
>
>int mpz_tstbit (mpz_t op, unsigned long int bit_index)
>
>  Why not:
>bool mpz_tstbit (mpz_t op, unsigned long int bit_index)

Because bool is a c++ specific keyword and gmp is built to be used with 
standatd 'c'.  Standard 'c' doesn't know about 'bool'.

>  Why not:
>int mpz_tstbit (mpz_t op, mpz_t bit_index)

Because it wouldn't make much sence to test bits larger than a long int.  
This would be a test un a number that is 4 bilion bits wide.  So, for speed 
concert, we use a unsigned long.

>  Regards,
>
>  Cpm.

Eric.

_________________________________________________________________
The new MSN 8: smart spam protection and 3 months FREE*.  
http://join.msn.com/?page=features/junkmail&xAPID=42&PS=47575&PI=7324&DI=7474&SU= 
http://www.hotmail.msn.com/cgi-bin/getmsg&HL=1216hotmailtaglines_smartspamprotection_3mf