BitWiseLeadingZeros / Computation Layer

Count consecutive zero bits from the most significant bit until the first one. Similar to GCC's __builtin_clz or Python's bit_length() with adjustment.

Example bit pattern: 00001111 → 4 leading zeros

Common applications:

  • Number normalization
  • Floating-point manipulation
  • Data compression analysis
  • Binary search optimization
  • Numeric range analysis

Note: Useful for determining required bit width for storage.

Table
0
0
Table

Transforms

[, ...]

Select

column

The integer column to count leading zeros. Examples:

  • 0x000F → 12 leading zeros (16-bit)
  • 0x0000 → all bits leading zeros
  • 0xFFFF → 0 leading zeros

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.