Home > Back-end >  The farmer across the river problem
The farmer across the river problem

Time:10-07

The movers <=1 is what meaning, such as the movers to 1 after the execution result how

CodePudding user response:

The left one, equivalent to take 2

CodePudding user response:

This is a bit operations, & lt; Is moves to the right, to the operation of the binary
Operation and general operators, such as + + 1 + 1, the results of the variables is +=1 + 1 to assign variables
Similarly, & lt; <1 left one, variable & lt; <=1 is the outcome of variable left one again is assigned to the variable
Because is binary, so the left one is equivalent to multiply by 2, moves to the right one is divided by 2,
For example, to move 1 byte 8 bit, for example, a binary 0 0000001 (decimal), the left one into a 0000001 - 0 (2) decimal, high part with low fill 0, decimal Numbers from 1 to 2, and is equivalent to multiply by 2,

CodePudding user response:

reference 1/f, the truth is right or wrong response:
left one equivalent to take 2

Why add an equal sign, direct movers <1, is that ok

CodePudding user response:

Similar to the I +=1;
I +=1;
I=I +;
=======
M<=1;
The equivalent of m=m<1;
  • Related