Ask your own question, for FREE!
Mathematics 20 Online
OpenStudy (anonymous):

Has anyone here used GMP? http://gmplib.org/ Would you recommend it if I am writing C programs to work with big numbers?

OpenStudy (anonymous):

I looked at the source and all of the number-crunching parts are in some arcane assembly language

OpenStudy (anonymous):

assembly language?

OpenStudy (anonymous):

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)

OpenStudy (anonymous):

ah, bh, al, bl are byte register

OpenStudy (anonymous):

will they help me multiply two big numbers together?

OpenStudy (anonymous):

ah, bh, al, bl are only 8 bit registers.. They can only hold a number from 0 to 256

OpenStudy (anonymous):

You need maybe 32 bit registers like EAX ,EBX, ECX, EDX.. there are even 64 bit registers but i dont know what they are.

OpenStudy (anonymous):

I just want to multiply two large numbers

OpenStudy (anonymous):

how large are these numbers?

OpenStudy (anonymous):

If its in C, cant you use a Unsigned Long Long or something like that??

OpenStudy (anonymous):

64 bit registers are called RAX, RBX RCX RDX.. that should make some big numbers.

OpenStudy (anonymous):

18446744073709551617

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!