aboutsummaryrefslogtreecommitdiff
path: root/src/type.zig
diff options
context:
space:
mode:
authorCody Tapscott <topolarity@tapscott.me>2022-06-07 10:58:49 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-06-07 20:07:40 -0400
commit70dc910086582b028d404d5de5049ceae0a95161 (patch)
tree2d7f608a2a8021e3754695353e188222d040a553 /src/type.zig
parent6ff7b437ff34e9a416a041c0c0ff8a65bae8daf5 (diff)
downloadzig-70dc910086582b028d404d5de5049ceae0a95161.tar.gz
zig-70dc910086582b028d404d5de5049ceae0a95161.zip
std.math: Add O(log N) implementation of log2(x) for comptime_int
Since Zig provides @clz and not @ffs (find-first-set), log2 for comptime integers needs to be computed algorithmically. To avoid hitting the backward branch quota, this updates log2(x) to use a simple O(log N) algorithm.
Diffstat (limited to 'src/type.zig')
0 files changed, 0 insertions, 0 deletions