Array.Arrays.index: def of bend-osdev-array@0.1.0.1 Import: import bend-osdev-array@0.1.0.1/array.bend as Array Lines 44-47 of bend-osdev-array@0.1.0.1/array.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-array@0.1.0.1/array.bend&start_line=44&end_line=47 import Base # the slot that Array.get and Array.set use for index i on an array of depth # d: i masked to its low d bits, as Base computes it def Arrays.index(d: Nat, i: U32) -> Nat: U32.to_nat(U32.and(i, U32.sub(U32.shln(1, d), 1))) Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shln https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat