MCPcopy Create free account
hub / github.com/cockroachdb/apd / BitLen

Method BitLen

bigint.go:444–456  ·  view source on GitHub ↗

BitLen calls (big.Int).BitLen.

()

Source from the content-addressed store, hash-verified

442
443// BitLen calls (big.Int).BitLen.
444func (z *BigInt) BitLen() int {
445 if z.isInline() {
446 // Find largest non-zero inline word.
447 for i := len(z._inline) - 1; i >= 0; i-- {
448 if z._inline[i] != 0 {
449 return i*bits.UintSize + bits.Len(uint(z._inline[i]))
450 }
451 }
452 return 0
453 }
454 var tmp1 big.Int //gcassert:noescape
455 return z.inner(&tmp1).BitLen()
456}
457
458// Bits calls (big.Int).Bits.
459func (z *BigInt) Bits() []big.Word {

Callers 8

TestBigIntFillBytesFunction · 0.80
NumDigitsFunction · 0.80
TestBigIntBitLenFunction · 0.80
testBitsetFunction · 0.80
AppendMethod · 0.80
DecomposeMethod · 0.80

Calls 2

isInlineMethod · 0.95
innerMethod · 0.95

Tested by 5

TestBigIntFillBytesFunction · 0.64
TestBigIntBitLenFunction · 0.64
testBitsetFunction · 0.64