count_leading_zeros on 64-bit ppc
dmharvey at math.harvard.edu
Sun Jun 3 23:37:15 CEST 2007
On Jun 3, 2007, at 5:21 PM, Torbjorn Granlund wrote:
> You're not using the macro properly.
> Your example works wrong, perhaps because it gets a 32-bit gmp.h,
> or something else.
> But in a proper 64-bit gmp context, it works right.
I'm pretty sure this is a 64-bit build. To be sure, I'm now compiling
gcc -m64 count-test.c -I/Users/david/gmp/install/include/ -L/Users/
I also have added the following code to check this:
unsigned long x = 0x0000000001379102;
unsigned long c;
mpz_mul_2exp(y, y, 50);
Presumably if it was a 32-bit build then 2^50 would not fit into a
> I'll let you debug the exact cause of the failure. :-)
It sounds as if you are suggesting that you know exactly what is
wrong, and you are teasing me :-) If you do know, it would probably
take 30 seconds of your time to give me a clue that would save many
hours of my time, which would be much appreciated.
More information about the gmp-bugs