Fast way to find the lowest set bit in a mask?

BlitzMax Forums/BlitzMax Programming/Fast way to find the lowest set bit in a mask?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Something like
Function BitGet:Int(value:Int, bit:Int)
	Return value&(1 Shl bit)
EndFunction


It returns non-zero if the bit is set otherwise zero

Edit: Nvm, I thought you were asking to check a bit at a certain position.