math.IntToBin

From Garry's Mod
Jump to: navigation, search
 math.IntToBin( )

Contents

Description

Converts an integer to a binary (base-2) string.

Arguments

number int

Number to be converted.

Returns

string

Binary number string. The length of this will always be a multiple of 3.

Examples

Example

Prints the binary representation of 4

print(math.IntToBin(4))

Output:

100
Personal tools
Navigation