Home > Back-end >  I am a little white
I am a little white

Time:09-28

What is the function of static look-up table, and comparing the test; What is the difference between them, and how a principle, look forward to the answer of,
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
  • Related