作者executor1107 (計概讓人起笑...)
看板NSYSU-CSE97
標題[分享] [計概] [Chapter 4.3] 隨手整理
時間Sat Dec 18 02:23:17 2004
4.3
Shift Operation.
"You must be careful about shift operations. If the pattern represents a
signed number,a shift operation may change the leftmost bits of the
operation, which is a sign umber."
Remark: Shift operations can only be used when a pattern represent an
unsigned number.
就是左移右移的動作,例題很有趣,Example 16要你把某數除2
結果發現Binary Operation裡"A right shift operation divides the number by 2"
Example 17則要你"Use a combination of logical and shift operations
to find the value (0 or 1) of the forth bit (from the right) in a
bit pattern."
結果用AND operator保存第四個數字下來,再用right shift的方法把它移到
最右邊就可以讀了.
--
......ID......
......I am a learning Dancer......
Shake my body through the music...
Dance with the Feel...
This is my ID......
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.117.186.180
※ 編輯: executor1107 來自: 140.117.186.180 (12/18 02:24)