-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Comments
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. |
excellent! let me know if/when you want some code review. |
There's also an arbitrary precision integer implementation in LLVM which may be clearer to read than GMP |
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.
|
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.
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.
We're going to need it when we eventually self-host (#89)
The text was updated successfully, but these errors were encountered: