--- title: "getBit" description: "This function returns the bit value (an integer, 0 or 1) in the number at position position, according to its binary representation." --- # getBit > This function returns the bit value (an integer, 0 or 1) in the number at position position, according to its binary representation. **This function is used by Ignition's Expression language.** ## Description This function returns the bit value (an integer, 0 or 1) in the number at position position, according to its binary representation. The least significant bit in a number is position 0. ## Syntax `getBit(number, position)` ### Parameters | Type | Parameter | Description | |---------|-------------|---------------------------------------------------------| | Integer | `number` | The number whose binary representation will be checked. | | Integer | `position` | The bit position to evaluate, where 0 is the least significant bit. | ### Returns **Integer** - Returns 0 or 1, depending on the bit value at the specified position. ## Examples ```python title="Code Snippet" getBit(0,0) //would return 0 ``` ```python title="Code Snippet" getBit(1,0) //would return 1 ``` ```python title="Code Snippet" getBit(8,2) //would return 0 ```