Int r=(n> 1) - 1; Int=c (n - 1) & gt;> 1; How do you explain.
CodePudding user response:
What does this have to do and what you say!N> 1, because computers use the binary number, so 2, moves to the right one is equal to the present so n> 1 is equivalent to n/2.
N<1 n the left one is equivalent to n * 2.
An arithmetic calculation, much faster than usual, so we often used, and static look-up table above, comparison test it doesn't matter, it's not that complicated,
Int r=(n> 1) - 1; Equivalent to int r=n/2-1;
Int=c (n - 1) & gt;> 1; Equivalent to int=c (n - 1)/2;
This is an arithmetic calculation rules, the hope can get help,
CodePudding user response:
Here are two questions, your answer is very helpful, thank you for your answer, I try to put the question well, next time