Has anyone here used GMP? http://gmplib.org/ Would you recommend it if I am writing C programs to work with big numbers?
I looked at the source and all of the number-crunching parts are in some arcane assembly language
assembly language?
do { \ if (__builtin_constant_p (bh) && (bh) == 0) \ __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2" \ : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\ else if (__builtin_constant_p (bh) && (bh) == ~(UDItype) 0) \ __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2" \ : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\ else \ __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3" \ : "=r" (sh), "=&r" (sl) \ : "r" (ah), "r" (bh), "%r" (al), "rI" (bl)); \ } while (0)
ah, bh, al, bl are byte register
will they help me multiply two big numbers together?
ah, bh, al, bl are only 8 bit registers.. They can only hold a number from 0 to 256
You need maybe 32 bit registers like EAX ,EBX, ECX, EDX.. there are even 64 bit registers but i dont know what they are.
I just want to multiply two large numbers
how large are these numbers?
If its in C, cant you use a Unsigned Long Long or something like that??
64 bit registers are called RAX, RBX RCX RDX.. that should make some big numbers.
18446744073709551617
Join our real-time social learning platform and learn together with your friends!