function
bin
bin[type: DType](num: SIMD[type, 1], prefix: StringLiteral = "0b", /) -> String
Return the binary string representation an integral value.
print(bin(123))
print(bin(-123))
'0b1111011'
'-0b1111011'
Parameters:
- type (
DType
): The data type of the integral scalar.
Args:
- num (
SIMD[type, 1]
): An integral scalar value. - prefix (
StringLiteral
): The prefix of the formatted int.
Returns:
The binary string representation of num.
bin(b: SIMD[bool, 1], prefix: StringLiteral = "0b", /) -> String
Returns the binary representation of a scalar bool.
Args:
- b (
SIMD[bool, 1]
): A scalar bool value. - prefix (
StringLiteral
): The prefix of the formatted int.
Returns:
The binary string representation of b.
bin[T: Indexer](num: T, prefix: StringLiteral = "0b", /) -> String
Returns the binary representation of an indexer type.
Parameters:
- T (
Indexer
): The Indexer type.
Args:
- num (
T
): An indexer value. - prefix (
StringLiteral
): The prefix of the formatted int.
Returns:
The binary string representation of num.