R = dec2bin(D)
R = dec2bin(D, N)
| Parameter | Description |
|---|---|
| D | a non negative integer smaller than the value returned by flintmax, or a negative value of a signed integer class (int8, int16, int32, int64). |
| N | an integer value. number of digits. |
| Parameter | Description |
|---|---|
| R | result of dec2bin: char array. |
dec2bin converts decimal number to base 2.
A negative value of a signed integer class is converted using the two's complement representation over the native bit width of the type (8, 16, 32 or 64 bits), so dec2bin(int8(-1)) returns '11111111'.
Y = dec2bin(2)
Y = dec2bin(int8(-92), 8)
| Version | Description |
|---|---|
| 1.0.0 | initial version |