Menu Samaritan's Purse

DECBIN

Decimal to binary

SYNTAX

decbin ( int $number ) : string

PARAMETERS

number

Decimal value to convert

NEGATIVE DECIMAL POSITIVE DECIMAL BINARY
0 0
1 1
2 10
... ...
9223372036854775806 111111111111111111111111111111111111111111111111111111111111110
9223372036854775807 (largest signed integer) 111111111111111111111111111111111111111111111111111111111111111 (63)
-9223372036854775808 9223372036854775808 1000000000000000000000000000000000000000000000000000000000000000
... ... ...
-2 18446744073709551614 1111111111111111111111111111111111111111111111111111111111111110
-1 18446744073709551615 (largest unsigned integer) 1111111111111111111111111111111111111111111111111111111111111111 (64)

RETURN

Binary string representation of number

EXAMPLES

1

0

2

1

3

10

4

111111111111111111111111111111111111111111111111111111111111110

5

111111111111111111111111111111111111111111111111111111111111111

6

1000000000000000000000000000000000000000000000000000000000000000
1000000000000000000000000000000000000000000000000000000000000000

7

1111111111111111111111111111111111111111111111111111111111111110
0

8

1111111111111111111111111111111111111111111111111111111111111111
0

PHP