big-number

long <-> str binary conversion

Is there any lib that convert very long numbers to string just copying the data? These one-liners are too slow: def xlong(s): return sum([ord(c) << e*8 for e,c in enumerate(s)]) def xstr(x): return chr(x&255) + xstr(x >> 8) if x else '' print xlong('abcd'*1024) % 666 print xstr(13**666) ...

Arbitrary-precision arithmetic Explanation

I'm trying to learn C and have come across the inability to work with REALLY big numbers (i.e., 100 digits, 1000 digits, etc.). I am aware that there exist libraries to do this, but I want to attempt to implement it myself. I just want to know if anyone has or can provide a very detailed, dumbed down explanation of arbitrary-precision a...