BitLength
BitLength[n]
整数 n を表すのに必要なバイナリビットの個数を与える.
例題
すべて開く すべて閉じる例 (2)
スコープ (2)
さまざまな正の値についてBitLengthをプロットする:
DiscretePlot[BitLength[n], {n, 2 ^ 10 - 1}, PlotRange -> All]BitLength[1000!]BitLength[1000!]特性と関係 (4)
BitLength[0]は1である:
BitLength[0]n が正のとき,BitLength[n]はFloor[Log[2,n]]+1に等しい:
With[{n = RandomInteger[{1, 2 ^ 32 - 1}]}, BitLength[n] == Floor[Log[2, n]] + 1]n が負のときはBitLength[BitNot[n]]である:
With[{n = RandomInteger[{1, 2 ^ 32 - 1}]}, BitLength[n] == BitLength[BitNot[n]]]BitLengthは
について対称である:
DiscretePlot[BitLength[n], {n, -20, 20}, PlotMarkers -> {Automatic, 8}]テクニカルノート
関連するガイド
-
▪
- ビット単位の演算 ▪
- メモリの計測と最適化 ▪
- ブール計算 ▪
- 整数関数
テキスト
Wolfram Research (2007), BitLength, Wolfram言語関数, https://reference.wolfram.com/language/ref/BitLength.html.
CMS
Wolfram Language. 2007. "BitLength." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/BitLength.html.
APA
Wolfram Language. (2007). BitLength. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BitLength.html
BibTeX
@misc{reference.wolfram_2026_bitlength, author="Wolfram Research", title="{BitLength}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/BitLength.html}", note=[Accessed: 14-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_bitlength, organization={Wolfram Research}, title={BitLength}, year={2007}, url={https://reference.wolfram.com/language/ref/BitLength.html}, note=[Accessed: 14-September-2026]}