float col = float (((i & 0x08) == 0) ^ ((j & 0x08) == 0));
& 0x08 performs bitwise and with 8, which means that it extracts the fourth least significant bit (1 is the least and then 2, 4, 8) from the numbers i and j . ^ is an exceptional OR operation: if both bits are the same, the result is 0, if they are different, the result is 1. This goes up to float external = float(...) , so col becomes 0.0 if i and j match, but 1.0 if they differ.
Why might this be helpful? It depends on what i and j . Presumably, the 4th bit encodes a specific condition or flag (logical), for example: whether a person is male or female. Operation & retrieves this, and then ^ says "are they different?". Why do you want a boolean expression to be converted to a float? There are not many good reasons to be honest - you can always allow the conversion to be done implicitly in the place where it was used (under the assumption of a man / woman):
bool hetero = i & 0x08 ^ j & 0x08; float estimated_children_from_coupling = 1.3 * hetero;
source share