023 (n> 0 & (n & (n-1) = 0) (keep it up), emui023.0
The role of the following code:
(N> 0 & (n & (n-1) = 0 ))
Simple: Determine whether n is an integer power of 2
Write programs calculate the number of binary digits that need to be modified from integer A to integer B.
Input: 31, 14
Output: 2
This question is also very simple: A and B are different or then calculate the number of 1 in the result
Code:
Int getModifyNum (const int vA, const int vB) {int Tmp = vA ^ vB; int Count = 0; while (Tmp> 0) {if (Tmp & 1) + + Count; Tmp >>= 1;} return Count ;}
It is known that the random variable Z follows the normal distribution N (0, Delta Region 2). If p (Z> 2) = 0023, p (-2 ≤ Z ≤ 2) =
0.954
It is known that the random variable ε normal distribution N (0 σ 2) If P (ε> 2) = 0023, P (-2 is less than or equal to ε less than or equal to 2) is equal? The answer is 0954
ε ~ If the normal distribution is N (0 σ 2), the image is symmetric on the Y axis.
P (-2 less than or equal to ε less than or equal to 2) = 1-1-P (ε> 2)-P (ε <2) = 1-2 P (ε> 2)