def main

bend-osdev-algo@0.1.0.0 · check.bend:36

import bend-osdev-algo@0.1.0.0/check.bend as Check
import Base
import bend-osdev-word64@0.1.0.0/word64.bend as W
import bend-osdev-algo@0.1.0.0/algo.bend as A
import bend-osdev-algo@0.1.0.0/bitmap.bend as M
import bend-osdev-algo@0.1.0.0/bsearch.bend as S

36def main() -> IO(Unit):
37  do IO<Unit>:
38    IO.print(Nat.show(A.bits32.popcount(3735928559)))
39    IO.print(Nat.show(A.bits32.ffs(40)) ++ " " ++ Nat.show(A.bits32.fls(40)))
40    IO.print(Nat.show(A.bits32.ctz(40)) ++ " " ++ Nat.show(A.bits32.clz(40)))
41    IO.print(show_maybe(A.bits32.first_set(0)) ++ " " ++ show_maybe(A.bits32.last_set(2147483648)))
42    IO.print(Nat.show(A.bits64.ctz(W.W64.from_parts(16, 0))) ++ " " ++ Nat.show(A.bits64.clz(W.W64.from_parts(16, 0))))
43    IO.print(Nat.show(A.bits64.popcount(W.W64.max())))
44    IO.print(Nat.show(M.bitmap.next_set([0, 8], 64n, 3n)) ++ " " ++ Nat.show(M.bitmap.next_clear([4294967295, 1], 64n, 0n)))
45    IO.print(Nat.show(M.bitmap.first_set([0, 0], 64n)))
46    IO.print(Nat.show(S.bsearch.lower_bound(sorted(), 12)) ++ " " ++ show_maybe(S.bsearch.find(sorted(), 13)))
47    IO.print(show_val(S.bsearch.array_lower_bound(fill(sorted(), 0, [0 : U32*8n]), 8, 12)) ++ " " ++ show_opt(S.bsearch.array_find(fill(sorted(), 0, [0 : U32*8n]), 8, 4)))

Uses (33)

Used by (0)

No other definition uses this definition.