Wilang Documentation1.0.0+4

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)

Expected result: "0b10".

See also#

oct · hex

All functions · Math guides