|
|
|
Сдвиги >>>
|
|||
|---|---|---|---|
|
#18+
Вот код Код: plaintext 1. Еще код Код: plaintext 1. Почему, может кто объяснит? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.07.2006, 12:13 |
|
||
|
Сдвиги >>>
|
|||
|---|---|---|---|
|
#18+
Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. al@mind:/pro/1$ javac A.java al@mind:/pro/1$ java A 10000000000000000000000000000000>>>1=01000000000000000000000000000000 11111111111111111111111111111111>>>1=01111111111111111111111111111111 Где проблема? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.07.2006, 12:29 |
|
||
|
Сдвиги >>>
|
|||
|---|---|---|---|
|
#18+
Проблема в том, что значения i и j не те, что ты написал;) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.07.2006, 12:31 |
|
||
|
Сдвиги >>>
|
|||
|---|---|---|---|
|
#18+
автор10000000000000000000000000000000>>>1=01000000000000000000000000000000 11111111111111111111111111111111>>>1=01111111111111111111111111111111 Т.е. -1 = 11111111111111111111111111111111 !!???? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.07.2006, 12:46 |
|
||
|
Сдвиги >>>
|
|||
|---|---|---|---|
|
#18+
Автор, вообще-то -1 это как раз набор всех единиц. А не 1000...0000 -2147483648 = 10000000000000000000000000000000 -1 = 11111111111111111111111111111111 Ты что-то не так понимаешь. ====================== - Я подхожу к клетке с медведем панда... Видите, какие у него черные круги под глазами?! Медведь панда как бы всем своим видом говорит нам: "Не бухайте!" ====================== ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.07.2006, 13:12 |
|
||
|
Сдвиги >>>
|
|||
|---|---|---|---|
|
#18+
Я в шоке... авторThe value of n>>>s is n right-shifted s bit positions with zero-extension. If n is positive, then the result is the same as that of n>>s; if n is negative, the result is equal to that of the expression (n>>s)+(2<<~s) if the type of the left-hand operand is int , and to the result of the expression (n>>s)+(2L<<~s) if the type of the left-hand operand is long. The added term (2<<~s) or (2L<<~s) cancels out the propagated sign bit. (Note that, because of the implicit masking of the right-hand operand of a shift operator, ~s as a shift distance is equivalent to 31-s when shifting an int value and to 63-s when shifting a long value.) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.07.2006, 14:05 |
|
||
|
Сдвиги >>>
|
|||
|---|---|---|---|
|
#18+
ТимоН автор10000000000000000000000000000000>>>1=01000000000000000000000000000000 11111111111111111111111111111111>>>1=01111111111111111111111111111111 Т.е. -1 = 11111111111111111111111111111111 !!???? Отрицательные числа в дополнительном коде записываются. Инверсией + 1. Т.е. -1 -> !1 + 1 -00000001 -> 11111110 + 1 = 11111111 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.07.2006, 17:12 |
|
||
|
|

start [/forum/topic.php?fid=59&msg=33832507&tid=2148767]: |
0ms |
get settings: |
11ms |
get forum list: |
17ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
211ms |
get topic data: |
11ms |
get forum data: |
3ms |
get page messages: |
45ms |
get tp. blocked users: |
1ms |
| others: | 223ms |
| total: | 528ms |

| 0 / 0 |
