- データがnビットの場合、表せる数値は2^n通りである。
- 符号なし整数の場合、表せる数値の範囲は0〜2^n
- 符号つき整数の場合、表せる数値の範囲は-2^(n-1)〜2^(n-1)-1
- 負の補数は、全ビットを反転させ、+1して求めることができる。
8ビットの場合
−1→11111111
−5→00000101(5)→11111010→11111011
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme