def room

bend-kit-bytes@0.3.3.0 · bytes.bend:360

import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
import Base

360# Does a buffer holding len bytes have room for n? Its 2^d words fit the fewest that hold len.
361def room(+len: U32, +n: U32) -> Bool:
362  U32.is_le(words(n), U32.shln(1, depth(words(len))))

Uses (6)

Used by (1)