diff options
| author | Cody Tapscott <topolarity@tapscott.me> | 2022-06-07 10:58:49 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-06-07 20:07:40 -0400 |
| commit | 70dc910086582b028d404d5de5049ceae0a95161 (patch) | |
| tree | 2d7f608a2a8021e3754695353e188222d040a553 /src/Compilation.zig | |
| parent | 6ff7b437ff34e9a416a041c0c0ff8a65bae8daf5 (diff) | |
| download | zig-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/Compilation.zig')
0 files changed, 0 insertions, 0 deletions
