aboutsummaryrefslogtreecommitdiff
path: root/lib/std/math/sqrt.zig
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2020-09-05 13:58:02 +0300
committerGitHub <noreply@github.com>2020-09-05 13:58:02 +0300
commit41bbadbb9a27107da539e27e175f5bdb52656bd5 (patch)
tree48a89b9ef19eedded7d5b8f3ab9e5e40efacf528 /lib/std/math/sqrt.zig
parentcff14dc2c67d9a35ae2c3e07bd6d2c5594d8a0a1 (diff)
parent09c861b829480be525a787e54117c108705256e6 (diff)
downloadzig-41bbadbb9a27107da539e27e175f5bdb52656bd5.tar.gz
zig-41bbadbb9a27107da539e27e175f5bdb52656bd5.zip
Merge pull request #6246 from Vexu/field
Remove deprecated fields on `type`
Diffstat (limited to 'lib/std/math/sqrt.zig')
-rw-r--r--lib/std/math/sqrt.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/math/sqrt.zig b/lib/std/math/sqrt.zig
index 34851ca647..1c0b15c3de 100644
--- a/lib/std/math/sqrt.zig
+++ b/lib/std/math/sqrt.zig
@@ -36,10 +36,10 @@ pub fn sqrt(x: anytype) Sqrt(@TypeOf(x)) {
}
}
-fn sqrt_int(comptime T: type, value: T) std.meta.Int(false, T.bit_count / 2) {
+fn sqrt_int(comptime T: type, value: T) std.meta.Int(false, @typeInfo(T).Int.bits / 2) {
var op = value;
var res: T = 0;
- var one: T = 1 << (T.bit_count - 2);
+ var one: T = 1 << (@typeInfo(T).Int.bits - 2);
// "one" starts at the highest power of four <= than the argument.
while (one > op) {
@@ -55,7 +55,7 @@ fn sqrt_int(comptime T: type, value: T) std.meta.Int(false, T.bit_count / 2) {
one >>= 2;
}
- const ResultType = std.meta.Int(false, T.bit_count / 2);
+ const ResultType = std.meta.Int(false, @typeInfo(T).Int.bits / 2);
return @intCast(ResultType, res);
}