bin#
Format a number as binary
Available in: math cells, REPL.
Syntax#
bin(value)
Arguments and behavior#
Returns a binary string including the 0b prefix, so bin(5) is 0b101. The input is rounded to an integer first.
Example#
Edit the inputs, then use Run or Reset. Changes stay in this example.
Example
bin(2)Interactive examples could not load. You can still copy the expressions.
Expected result: "0b10".