getBit

fun getBit(x: Int, i: Int): Boolean

Returns true iff the i'th bit of x is set to 1.