mirror of
https://codeberg.org/ziglang/zig
synced 2026-11-18 07:05:05 +00:00
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.
53 lines
1.7 KiB
53 lines
1.7 KiB