I need some code to do some big math.
Like 12345678901234567890 x 987654321987654321
Must be in C and must be documented correctly.
Has anybody got some sourcecode?
Define "big". As in "how many bits does the biggest number that
will every occur have".
That would amount to multiplying two 64-bit integers to get a
128-bit result. Since the compiler can natively work with 64-bit
integers, this means four multiplications, some additions, and some
overflow checking. Unfortunately, the latter is much easier (since
it's pretty much automatic) in assembly than in C (where it requires
Please specify your requirements more clearly. What's the bit
width of the numbers you're working with, which arithmetic operations
do you require, etc.