W64.est_pick: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/src/math/w64.bend as W64 Lines 330-339 of bend-collections@1.0.0.0/src/math/w64.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/src/math/w64.bend&start_line=330&end_line=339 import Base import bend-collections@1.0.0.0/src/math/u64.bend as W # min(floor(y / d), 2^32 - 1) for d > 0: when hi(y) >= d the quotient needs # more than 32 bits; otherwise the high word is its own remainder, and div32's # two 16-bit Nat digit steps finish the division without dividing the high # word. def est_pick(+y: W.U64, +d: U32, big: Bool) -> U32: match big: case True{}: 4294967295 case False{}: est_mid(lo(y), dig_t(U32.to_nat(hi(y)), 65536n, dig1(lo(y))), U32.to_nat(d)) Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/math/u64.bend&name=U64 https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/math/w64.bend&name=dig1 https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/math/w64.bend&name=dig_t https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/math/w64.bend&name=est_mid https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/math/w64.bend&name=hi https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/math/w64.bend&name=lo