
Leading binary-expansion bits of a point in the unit interval
Source:R/bnp_ghosal.R
morie_gh_pt_bits.RdReturns the first depth bits of the binary expansion of
x, which index the nested dyadic Polya-tree partition
containing x. The input is first clamped to
\([0, 1 - 10^{-15}]\), so values outside the unit interval are
silently pulled to the nearest end.
Examples
morie_gh_pt_bits(x = c(1, 2, 3, 4, 5, 6, 7, 8), depth = 5L)
#> [1] 1 1 1 1 1