BitWiseLeadingOnes / Computation Layer

Count consecutive one bits from the most significant bit until the first zero. Similar to GCC's __builtin_clz with bitwise NOT.

Example bit pattern: 11110000 → 4 leading ones

Common applications:

  • Priority encoding
  • Network subnet masks
  • Permission bit analysis
  • Range boundary detection
  • Binary data alignment

Note: Count starts from the most significant bit position.

Table
0
0
Table

Transforms

[, ...]

Select

column

The integer column to count leading ones. Examples:

  • 0xF000 → 4 leading ones
  • 0xFFFF → 16 leading ones
  • 0x0FFF → 0 leading ones

Must be an integer type column

Name for the new column. If not provided, the system generates a unique name. If AsColumn matches an existing column, the existing column is replaced. The name should follow valid column naming conventions.