As per the previous comments, don't do this.
ES 2 hardware needn't natively support integers; it is permitted to emulate them as floating point. To permit that, direct bit tests aren't defined.
If you're absolutely desperate, use a mod
and a step
. E.g. to test the third bit of the integer value
:
float bit = step(0.5, mod(float(value) / 8.0, 1.0));
// bit is now 1.0 if the lowest bit was set, 0.0 otherwise
The logic being to shuffle the bit you want to test into the 0.5
position then cut off all bits above it with the mod
. Then the value you have can be greater than or equal to 0.5
only if the bit you wanted was set.