diff options
| author | Tadeo Kondrak <me@tadeo.ca> | 2020-04-28 19:10:09 -0600 |
|---|---|---|
| committer | Tadeo Kondrak <me@tadeo.ca> | 2020-04-28 19:11:31 -0600 |
| commit | 350b2adacda217014dc511ccc4cd73f22ddaac22 (patch) | |
| tree | 519115799840c1abe4be6aa708a3ca5079fbd817 /lib/std/math | |
| parent | eb183ad9febef775efabb1a4592f84d6cf088c28 (diff) | |
| download | zig-350b2adacda217014dc511ccc4cd73f22ddaac22.tar.gz zig-350b2adacda217014dc511ccc4cd73f22ddaac22.zip | |
std.meta.IntType -> std.meta.Int
Diffstat (limited to 'lib/std/math')
| -rw-r--r-- | lib/std/math/big/int.zig | 8 | ||||
| -rw-r--r-- | lib/std/math/big/rational.zig | 6 | ||||
| -rw-r--r-- | lib/std/math/cos.zig | 2 | ||||
| -rw-r--r-- | lib/std/math/pow.zig | 2 | ||||
| -rw-r--r-- | lib/std/math/sin.zig | 2 | ||||
| -rw-r--r-- | lib/std/math/sqrt.zig | 6 | ||||
| -rw-r--r-- | lib/std/math/tan.zig | 2 |
7 files changed, 14 insertions, 14 deletions
diff --git a/lib/std/math/big/int.zig b/lib/std/math/big/int.zig index 693a360fa9..f5d65a6866 100644 --- a/lib/std/math/big/int.zig +++ b/lib/std/math/big/int.zig @@ -9,8 +9,8 @@ const maxInt = std.math.maxInt; const minInt = std.math.minInt; 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); +pub const DoubleLimb = std.meta.Int(false, 2 * Limb.bit_count); +pub const SignedDoubleLimb = std.meta.Int(true, DoubleLimb.bit_count); pub const Log2Limb = math.Log2Int(Limb); comptime { @@ -272,7 +272,7 @@ pub const Int = struct { switch (@typeInfo(T)) { .Int => |info| { - const UT = if (T.is_signed) std.meta.IntType(false, T.bit_count - 1) else T; + const UT = if (T.is_signed) std.meta.Int(false, T.bit_count - 1) else T; try self.ensureCapacity(@sizeOf(UT) / @sizeOf(Limb)); self.metadata = 0; @@ -335,7 +335,7 @@ pub const Int = struct { pub fn to(self: Int, comptime T: type) ConvertError!T { switch (@typeInfo(T)) { .Int => { - const UT = std.meta.IntType(false, T.bit_count); + const UT = std.meta.Int(false, T.bit_count); if (self.bitCountTwosComp() > T.bit_count) { return error.TargetTooSmall; diff --git a/lib/std/math/big/rational.zig b/lib/std/math/big/rational.zig index 21e89ff8c4..f5f2f53113 100644 --- a/lib/std/math/big/rational.zig +++ b/lib/std/math/big/rational.zig @@ -127,8 +127,8 @@ pub const Rational = struct { // Translated from golang.go/src/math/big/rat.go. debug.assert(@typeInfo(T) == .Float); - const UnsignedIntType = std.meta.IntType(false, T.bit_count); - const f_bits = @bitCast(UnsignedIntType, f); + const UnsignedInt = std.meta.Int(false, T.bit_count); + const f_bits = @bitCast(UnsignedInt, f); const exponent_bits = math.floatExponentBits(T); const exponent_bias = (1 << (exponent_bits - 1)) - 1; @@ -186,7 +186,7 @@ pub const Rational = struct { debug.assert(@typeInfo(T) == .Float); const fsize = T.bit_count; - const BitReprType = std.meta.IntType(false, T.bit_count); + const BitReprType = std.meta.Int(false, T.bit_count); const msize = math.floatMantissaBits(T); const msize1 = msize + 1; diff --git a/lib/std/math/cos.zig b/lib/std/math/cos.zig index 8a599aece4..aa336769b1 100644 --- a/lib/std/math/cos.zig +++ b/lib/std/math/cos.zig @@ -44,7 +44,7 @@ const pi4c = 2.69515142907905952645E-15; const m4pi = 1.273239544735162542821171882678754627704620361328125; fn cos_(comptime T: type, x_: T) T { - const I = std.meta.IntType(true, T.bit_count); + const I = std.meta.Int(true, T.bit_count); var x = x_; if (math.isNan(x) or math.isInf(x)) { diff --git a/lib/std/math/pow.zig b/lib/std/math/pow.zig index ac6aee4cce..cb39dd59e3 100644 --- a/lib/std/math/pow.zig +++ b/lib/std/math/pow.zig @@ -145,7 +145,7 @@ pub fn pow(comptime T: type, x: T, y: T) T { var xe = r2.exponent; var x1 = r2.significand; - var i = @floatToInt(std.meta.IntType(true, T.bit_count), yi); + var i = @floatToInt(std.meta.Int(true, T.bit_count), yi); while (i != 0) : (i >>= 1) { const overflow_shift = math.floatExponentBits(T) + 1; if (xe < -(1 << overflow_shift) or (1 << overflow_shift) < xe) { diff --git a/lib/std/math/sin.zig b/lib/std/math/sin.zig index 0c339ba1f2..e88f5eeeaf 100644 --- a/lib/std/math/sin.zig +++ b/lib/std/math/sin.zig @@ -45,7 +45,7 @@ const pi4c = 2.69515142907905952645E-15; const m4pi = 1.273239544735162542821171882678754627704620361328125; fn sin_(comptime T: type, x_: T) T { - const I = std.meta.IntType(true, T.bit_count); + const I = std.meta.Int(true, T.bit_count); var x = x_; if (x == 0 or math.isNan(x)) { diff --git a/lib/std/math/sqrt.zig b/lib/std/math/sqrt.zig index e5d8a822f5..097b0152f7 100644 --- a/lib/std/math/sqrt.zig +++ b/lib/std/math/sqrt.zig @@ -31,7 +31,7 @@ pub fn sqrt(x: var) Sqrt(@TypeOf(x)) { } } -fn sqrt_int(comptime T: type, value: T) std.meta.IntType(false, T.bit_count / 2) { +fn sqrt_int(comptime T: type, value: T) std.meta.Int(false, T.bit_count / 2) { var op = value; var res: T = 0; var one: T = 1 << (T.bit_count - 2); @@ -50,7 +50,7 @@ fn sqrt_int(comptime T: type, value: T) std.meta.IntType(false, T.bit_count / 2) one >>= 2; } - const ResultType = std.meta.IntType(false, T.bit_count / 2); + const ResultType = std.meta.Int(false, T.bit_count / 2); return @intCast(ResultType, res); } @@ -66,7 +66,7 @@ test "math.sqrt_int" { /// Returns the return type `sqrt` will return given an operand of type `T`. pub fn Sqrt(comptime T: type) type { return switch (@typeInfo(T)) { - .Int => |int| std.meta.IntType(false, int.bits / 2), + .Int => |int| std.meta.Int(false, int.bits / 2), else => T, }; } diff --git a/lib/std/math/tan.zig b/lib/std/math/tan.zig index 737f5b0e09..86f473f448 100644 --- a/lib/std/math/tan.zig +++ b/lib/std/math/tan.zig @@ -38,7 +38,7 @@ const pi4c = 2.69515142907905952645E-15; const m4pi = 1.273239544735162542821171882678754627704620361328125; fn tan_(comptime T: type, x_: T) T { - const I = std.meta.IntType(true, T.bit_count); + const I = std.meta.Int(true, T.bit_count); var x = x_; if (x == 0 or math.isNan(x)) { |
