How does one calculate 2 ^ -18 ?

Bruce M. Axtens bruce.axtens at
Wed Jan 7 03:50:10 CET 2009

Please pardon the mathematical naivete: I passed -18 to mpz_pow_ui and 
the code crashed. No surprises there ("read the friendly manual, you 
goose!")  So I went back to the manual and tried to get my mind around 
mpz_powm and related things. I'm still as confused as before. Please, 
someone, take pity on me and demonstrate in a bit of C how to raise 2 to 
the negative 18.

Kind regards,

More information about the gmp-discuss mailing list