uint64_t
is an integer type. uint64_t msk;
declares a variable of that type and (uint64_t) 0
casts 0
to that type since the literal 0
is an int
. Similarly, (uint64_t)(high - low + 1)
casts the result of a calculation to the type uint64_t
. However, this second cast is unnecessary, as discussed in the comments since the type of the result of <<
only depends on the type of the first operand and not the second.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…