diff options
| author | Veikka Tuominen <git@vexu.eu> | 2020-09-05 13:58:02 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-05 13:58:02 +0300 |
| commit | 41bbadbb9a27107da539e27e175f5bdb52656bd5 (patch) | |
| tree | 48a89b9ef19eedded7d5b8f3ab9e5e40efacf528 /lib/std/math/big.zig | |
| parent | cff14dc2c67d9a35ae2c3e07bd6d2c5594d8a0a1 (diff) | |
| parent | 09c861b829480be525a787e54117c108705256e6 (diff) | |
| download | zig-41bbadbb9a27107da539e27e175f5bdb52656bd5.tar.gz zig-41bbadbb9a27107da539e27e175f5bdb52656bd5.zip | |
Merge pull request #6246 from Vexu/field
Remove deprecated fields on `type`
Diffstat (limited to 'lib/std/math/big.zig')
| -rw-r--r-- | lib/std/math/big.zig | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/std/math/big.zig b/lib/std/math/big.zig index 6246a4fb8b..03257e35ea 100644 --- a/lib/std/math/big.zig +++ b/lib/std/math/big.zig @@ -9,14 +9,15 @@ const assert = std.debug.assert; pub const Rational = @import("big/rational.zig").Rational; pub const int = @import("big/int.zig"); pub const Limb = usize; -pub const DoubleLimb = std.meta.IntType(false, 2 * Limb.bit_count); -pub const SignedDoubleLimb = std.meta.IntType(true, DoubleLimb.bit_count); +const limb_info = @typeInfo(Limb).Int; +pub const DoubleLimb = std.meta.IntType(false, 2 * limb_info.bits); +pub const SignedDoubleLimb = std.meta.IntType(true, 2 * limb_info.bits); pub const Log2Limb = std.math.Log2Int(Limb); comptime { - assert(std.math.floorPowerOfTwo(usize, Limb.bit_count) == Limb.bit_count); - assert(Limb.bit_count <= 64); // u128 set is unsupported - assert(Limb.is_signed == false); + assert(std.math.floorPowerOfTwo(usize, limb_info.bits) == limb_info.bits); + assert(limb_info.bits <= 64); // u128 set is unsupported + assert(limb_info.is_signed == false); } test "" { |
