Reputation: 14836
I would like to use the equivalent of the btest
function in Fortran in Python. Do you know if there's something I could use?
Upvotes: 1
Views: 554
Reputation: 142136
I think something like:
def btest(i, pos):
return i & (1 << pos)
Upvotes: 3