bin

bin — converts numbers into binary form.

Syntax

bin (number)

		

Arguments

number

Any number.

Returns

An integer number in binary format.

Description

This function casts any number to an integer, and returns it in a binary representation. Floating point numbers are truncated.

Example

Gamma> bin(12);
0b1100
Gamma> bin(12.9342);
0b1100
Gamma> bin(0x3b);
0b00111011
Gamma> bin(0o436);
0b000100011110
Gamma>  
		

See Also

dec, hex, oct