This is more of a general C++ question however I can’t find a simple answer on google (they all involve huge code loop programs).
To convert a number to bits (1, 2, 3, 4, 5, 6, becomes 1, 2, 4, 8, 16, 32)
bits = FMath::Pow(2, number - 1);
But how can I reverse that, so 1, 2, 4, 8, 16, 32, becomes 1, 2, 3, 4, 5, 6?
number = FMath::???(bits);
Thanks.
P.s. I’ve been using it forever but have never been 100% sure, is bits the right word to describe dealing with 2, 4, 8, 16, 32, &&, ||, etc in programming?