Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
2進数(2の補数)を2で割るにはどうすればよいですか。 ビットシフトを試しましたが、負の奇数に問題があります。どうすれば解決できますか?例えば :
(-7/2) 11001/2 => (shifts the number one place to the right) => 11100 (-4)
の後に使用できますか。?このような?
1 0011 . 1000 Part 1 2 3 4
パート1:負の数 パート2:メイク3 パート3:で区切る。 パート4:0.5になります
負の部分は次のように機能します。
.1000 = 0.5 .0100 = 0.25 .1100 = 0.75 .0010 = 0.125
したがって、2を掛ける代わりに、左にシフトします。右に2で割ることができます。つまり、ドット/2の後とドットx2の前です。
この情報をご利用いただければ幸いです。