GO語言"math/bits"包中"Len64"函數的用法及代碼示例。
用法:
func Len64(x uint64)(n int)
Len64 返回表示 x 所需的最小位數;對於 x == 0,結果為 0。
例子:
package main
import (
"fmt"
"math/bits"
)
func main() {
fmt.Printf("Len64(%064b) = %d\n", 8, bits.Len64(8))
}
輸出:
Len64(0000000000000000000000000000000000000000000000000000000000001000) = 4
相關用法
- GO Len8用法及代碼示例
- GO Len32用法及代碼示例
- GO Len16用法及代碼示例
- GO LeadingZeros32用法及代碼示例
- GO LeadingZeros8用法及代碼示例
- GO LeadingZeros16用法及代碼示例
- GO LeadingZeros64用法及代碼示例
- GO Logger.Output用法及代碼示例
- GO LastIndex用法及代碼示例
- GO Log10用法及代碼示例
- GO Log用法及代碼示例
- GO ListenAndServe用法及代碼示例
- GO Listener用法及代碼示例
- GO LastIndexAny用法及代碼示例
- GO Logger用法及代碼示例
- GO ListenAndServeTLS用法及代碼示例
- GO LoadLocation用法及代碼示例
- GO LastIndexFunc用法及代碼示例
- GO LoadX509KeyPair用法及代碼示例
- GO LookPath用法及代碼示例
注:本文由純淨天空篩選整理自golang.google.cn大神的英文原創作品 Len64。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。