x86-64 Big Integer Representation?
===

How do big integer libraries on x86-64 represent a big integer in memory?  (or does it vary?  Is there a most common way?)

Naively I was thinking about storing them as 0-terminated strings of numbers in base 2**64.

For example suppose X is in memory as:

    [8 bytes] Dn
    .
    .
    [8 bytes] D2
    [8 bytes] D1
    [8 bytes] D0
    [8 bytes] 0

Let B = 2**64

Then X = Dn * B**n + ... + D2 * B**2 + D1 * B**1 + D0

The empty string (ie 8 bytes of zero) means zero.

Is this a reasonable way?  What are the pros and cons of this way?  Is there a better way?

How would you handle signedness?  Does 2s compliment work with this variable length value?
