MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / AsDInt

Method AsDInt

pkg/sql/sem/tree/datum.go:577–582  ·  view source on GitHub ↗

AsDInt computes the integer value of the given bit array. The value is assumed to be encoded using two's complement. The result is truncated to the given integer number of bits, if specified. The given width must be 64 or smaller. The results are undefined if n is greater than 64.

(n uint)

Source from the content-addressed store, hash-verified

575// The given width must be 64 or smaller. The results are undefined
576// if n is greater than 64.
577func (d *DBitArray) AsDInt(n uint) *DInt {
578 if n == 0 {
579 n = 64
580 }
581 return NewDInt(DInt(d.BitArray.AsInt64(n)))
582}
583
584// ResolvedType implements the TypedExpr interface.
585func (*DBitArray) ResolvedType() *types.T {

Callers

nothing calls this directly

Calls 3

NewDIntFunction · 0.85
DIntTypeAlias · 0.85
AsInt64Method · 0.45

Tested by

no test coverage detected