aboutsummaryrefslogtreecommitdiff
path: root/std/math/log2.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-10-26 14:59:58 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-10-26 15:01:51 -0400
commit2b395d4ede2d8ef356c54e1c7c09da88c634be11 (patch)
treeddb9806afc26bc55554e20066b29d076bec71f79 /std/math/log2.zig
parent40b7652a6da135aed68a0067f2de60b8b276713c (diff)
downloadzig-2b395d4ede2d8ef356c54e1c7c09da88c634be11.tar.gz
zig-2b395d4ede2d8ef356c54e1c7c09da88c634be11.zip
remove @minValue,@maxValue; add std.math.minInt,maxInt
closes #1466 closes #1476
Diffstat (limited to 'std/math/log2.zig')
-rw-r--r--std/math/log2.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/std/math/log2.zig b/std/math/log2.zig
index 858f6ffa02..555c0bdf18 100644
--- a/std/math/log2.zig
+++ b/std/math/log2.zig
@@ -10,6 +10,7 @@ const math = std.math;
const assert = std.debug.assert;
const builtin = @import("builtin");
const TypeId = builtin.TypeId;
+const maxInt = std.math.maxInt;
pub fn log2(x: var) @typeOf(x) {
const T = @typeOf(x);
@@ -151,7 +152,7 @@ pub fn log2_64(x_: f64) f64 {
// hi + lo = f - hfsq + s * (hfsq + R) ~ log(1 + f)
var hi = f - hfsq;
var hii = @bitCast(u64, hi);
- hii &= u64(@maxValue(u64)) << 32;
+ hii &= u64(maxInt(u64)) << 32;
hi = @bitCast(f64, hii);
const lo = f - hi - hfsq + s * (hfsq + R);