MATLAB Function Reference |

**Syntax**

**Description**

`C = bitget(A,`

returns the value of the bit at position

)
*bit*

in *bit*`A`

. Operand `A`

must be a nonnegative integer, and

must be a number between 1 and the number of bits in the floating-point integer (flint) representation of *bit*`A`

(52 for IEEE flints). To ensure the operand is an integer, use the `ceil`

, `fix`

, `floor`

, and `round`

functions.

**Example**

The `dec2bin`

function converts decimal numbers to binary. However, you can also use the `bitget`

function to show the binary representation of a decimal number. Just test successive bits from most to least significant:

**See Also **

`bitand`

, `bitcmp`

, `bitmax`

, `bitor`

, `bitset`

, `bitshift`

, `bitxor`

bitcmp | bitmax |