mpz_gcd() returns different values on Linux and HP-UX
Niels Möller
nisse at lysator.liu.se
Mon Oct 13 21:06:19 CEST 2003
Prashanth PS <shanthps at india.hp.com> writes:
> I've been trying to install and work with GMP on HP-UX. If works
> just fine on Linux with Gcc. However the conversion of assembly file
> from invert_limb.asm to tmp-invert_limb.s and then to invert_limb.o
> does not work (bcoz of .section .rodata ). So I compiled
> invert_limb.o with "gcc" and the rest with HPUX' ansi C compiler.
You should send a bug report following the instructions in the GMP
manual.
> On i386 / Linux,
>
> num mp_size=1, mp_d=0
> m mp_size= 1, mp_d=1
> mpz_gcd(g,m,num);
> g=mp_alloc=1, mp_size= 1, mp_d=1
>
> On ia64 / HPUX
>
> num=mp_size=1, mp_d=0
> m mp_size= 1, mp_d=1
> mpz_gcd(g,m,num);
> g=mp_alloc=1, mp_size= 1, mp_d=2
It's a little hard to read this (a complete compilable test program
would have been nice), but if I understand the figures correctly, you
get gcd(0,1) == 1 on linux/x86 and gcd(0,1) == 2 on hpux. Then the
hpux result is incorrect.
/Niels
More information about the gmp-discuss
mailing list