Evaluate the number least-significant set bits before seeing an unset bit.
Description
Evaluate the number least-significant set bits before seeing an unset bit.
Usage
<Expr>$bitwise_trailing_ones()
Value
A polars expression
Examples
library("polars")
df <- pl$DataFrame(n = c(-1L, 0L, 2L, 1L))
df$with_columns(trailing_ones = pl$col("n")$bitwise_trailing_ones())
#> shape: (4, 2)
#> ┌─────┬───────────────┐
#> │ n ┆ trailing_ones │
#> │ --- ┆ --- │
#> │ i32 ┆ u32 │
#> ╞═════╪═══════════════╡
#> │ -1 ┆ 32 │
#> │ 0 ┆ 0 │
#> │ 2 ┆ 0 │
#> │ 1 ┆ 1 │
#> └─────┴───────────────┘