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

standard library: arbitrary precision integer #364

Closed
andrewrk opened this issue May 5, 2017 · 4 comments
Closed

standard library: arbitrary precision integer #364

andrewrk opened this issue May 5, 2017 · 4 comments
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library.
Milestone

Comments

@andrewrk
Copy link
Member

andrewrk commented May 5, 2017

We're going to need it when we eventually self-host (#89)

@andrewrk andrewrk added the enhancement Solving this issue will likely involve adding new logic or components to the codebase. label May 5, 2017
@andrewrk andrewrk added this to the 1.0.0 milestone May 5, 2017
@tiehuis
Copy link
Member

tiehuis commented May 24, 2017

Just wanted to mention that I've started implementing an arbitrary precision integer library over here. Very early days right now but it should eventually reach a reasonable point.

@andrewrk
Copy link
Member Author

andrewrk commented May 24, 2017

excellent! let me know if/when you want some code review.

@andrewrk
Copy link
Member Author

There's also an arbitrary precision integer implementation in LLVM which may be clearer to read than GMP

@tiehuis
Copy link
Member

tiehuis commented May 26, 2017

Interesting, did not know that (makes sense though). In terms of GMP, I haven't really looked at the code, largely due to its license. It's a bit arcane from memory too, though!

Just for reference, here are some implementations which are useful.

@andrewrk andrewrk added the standard library This issue involves writing Zig code for the standard library. label Aug 27, 2017
tiehuis added a commit that referenced this issue Jun 8, 2018
A few notes on the implementation:

 - Any unsigned power of two integer type less than 64 bits in size is supported
 as a Limb type.
 - The algorithms used are kept simple for the moment. More complicated
 algorithms are generally only more useful as integer sizes increase a
 lot and I don't expect our current usage to be used for this purpose
 just yet.
 - All branches (practically) have been covered by tests.

See https://github.com/tiehuis/zig-bn/tree/986a2b3243d0454b8430a6adf4ad48611850c1b8/bench
for rough performance comparison numbers.

Closes #364.
tiehuis added a commit that referenced this issue Jun 10, 2018
A few notes on the implementation:

 - Any unsigned power of two integer type less than 64 bits in size is supported
 as a Limb type.
 - The algorithms used are kept simple for the moment. More complicated
 algorithms are generally only more useful as integer sizes increase a
 lot and I don't expect our current usage to be used for this purpose
 just yet.
 - All branches (practically) have been covered by tests.

See https://github.com/tiehuis/zig-bn/tree/986a2b3243d0454b8430a6adf4ad48611850c1b8/bench
for rough performance comparison numbers.

Closes #364.
@andrewrk andrewrk modified the milestones: 1.0.0, 0.3.0 Sep 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library.
Projects
None yet
Development

No branches or pull requests

2 participants