Skip to content

support arbitrarily large integers #12

Description

@michaelficarra

Our current integers support magnitudes up to 264. Larger magnitudes will have to be encoded as floats/doubles or using binary* (losing the type info). Of course, this could be done via an extension point, but given the ubiquity of big integer libraries and especially with the addition of BigInt to JavaScript, I think built-in support might be worth it.

How could we do this? I recommend that we change uint64 to int64 (a signed 64-bit int) and replace nint64 with a VLQ. This would be a breaking change to the format.

edit: Alternatively, we could construct some sort of Rational representation using two VLQs.

edit again: I like git's "varint"s: https://github.com/git/git/blob/master/varint.c

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions