Skip to content

Commit dc8bda7

Browse files
committed
Add arbitrary-precision integer to std
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.
1 parent 0a95b0f commit dc8bda7

File tree

4 files changed

+2033
-0
lines changed

4 files changed

+2033
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ set(ZIG_STD_FILES
464464
"math/atan.zig"
465465
"math/atan2.zig"
466466
"math/atanh.zig"
467+
"math/big/int.zig"
467468
"math/cbrt.zig"
468469
"math/ceil.zig"
469470
"math/complex/abs.zig"

std/math/big/index.zig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pub use @import("int.zig");
2+
3+
test "math.big" {
4+
_ = @import("int.zig");
5+
}

0 commit comments

Comments
 (0)