Skip to content

daft.functions.bin#

bin #

bin(expr: Expression) -> Expression

Returns the string representation of the binary value of an integer.

Inputs are promoted to 64-bit before conversion; negatives produce 64-character two's-complement strings (e.g. bin(-1) returns 64 ones).

Source code in daft/functions/numeric.py
287
288
289
290
291
292
293
def bin(expr: Expression) -> Expression:
    """Returns the string representation of the binary value of an integer.

    Inputs are promoted to 64-bit before conversion; negatives produce
    64-character two's-complement strings (e.g. ``bin(-1)`` returns 64 ones).
    """
    return Expression._call_builtin_scalar_fn("bin", expr)