gmp_gcdext method on 32bit vs 64 bit machines

Waiki Wright waiki at linux.vnet.ibm.com
Fri Apr 15 23:37:59 CEST 2011


Hi,
Let me know if this is not the right place to post this question.

I have 2 machines- RedHat Rel6 64 bit and RedHat Rel6 32 bit.  I have 
php 5.3 and gmp 4.3 on both machines.

I am using gmp_gcdex() method from php to get the g, s, t values.
When I ran gmp_gcdex("34293864345", "23434293864345"); on the 64 bit and 
32 bit machines, I got different results for s & t:

On 64 bit: g=195, s= -20983781660442, t= 30707772373
On 32 bit: g=195, s= -4760039754357, t= 6965866288

I looked into how php treating big integers on 32 and 64 bit machine but 
did not find anything.

Does anyone have any idea why s & t values are different on 64 bit vs 32 
bit?

Thanks!

Waiki


More information about the gmp-discuss mailing list