">>" in this case is a binary operation, it's moves 1 byte to the right. but is

CMIIW

`integer`

is a variable?CMIIW

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

it's shouldn't "1 byte to the right" but "1

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

closed account (*zb0S216C*)

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}

Topic archived. No new replies allowed.