Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Big Integers #35

Open
booniepepper opened this issue Jul 16, 2023 · 0 comments
Open

Big Integers #35

booniepepper opened this issue Jul 16, 2023 · 0 comments
Milestone

Comments

@booniepepper
Copy link
Collaborator

This is a scripting language, and 64 bits doesn't make a ton of sense. (Weird to overflow in a scripting language, also weird and unexpected on 32 bit systems!)

Move DtVal.int to std.math.big.int.Mutable

The implementation I'm leaning towards is something like:

const Integer = union(enum) {
    usize: usize,
    big: std.math.big.int.Mutable,

    // Functions for add/sub/mul/div/comparison/etc that take other Integer
    // Functions like isUsize()/toUsize() and isBig()/toBig()
};

Start as usize and coerce up into larger representations. Probably exactly one GPA should be used and shared among all Integer.

@booniepepper booniepepper added this to the 2.0 milestone Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant