| naskopw (24) | |
| Can someone explain me what does "(integer + integer) >> 1" mean ... | |
|
|
|
| chipp (506) | |
">>" in this case is a binary operation, it's moves 1 byte to the right. but is integer is a variable?CMIIW | |
|
|
|
| gtkano (44) | |
|
edited my post because I was lying -.-' sorry for disinforming | |
|
Last edited on
|
|
| naskopw (24) | |
| What do you mean by "1 byte to the right"? and integer is not a varuable. | |
|
|
|
| chipp (506) | |
|
correction: it's shouldn't "1 byte to the right" but "1 bit to the right. what i mean about this is: binary expression for 4: 00000100 when you write: 4 >> 1; the result is: 2 because it shift 1 bit to the right, thus the binary expression is: 00000010 CMIIW | |
|
|
|
| naskopw (24) | |
| Thank you. Now I understand it. | |
|
|
|
| Framework (3116) | |
|
Note that shifting to the left is equivalent to multiplying by powers of two, and shifting to the right is equivalent to dividing by powers of 2. Wazzak | |
|
|
|