What can be a reason for converting an integer to a boolean in this way?
bool booleanValue = !!integerValue;
instead of just
A bool can only have two states, 0, and 1. An integer can have any state from -2147483648 to 2147483647 assuming a signed 32-bit integer. The unary ! operator outputs 1 if the input is 0 and outputs 0 if the input is anything except 0. So !0 = 1 and !234 = 0. The second ! simply switches the output so 0 becomes 1 and 1 becomes 0.
So the first statement guarantees that booleanValue will be be set equal to either 0 or 1 and no other value, the second statement does not.