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

Method AsDInt

pkg/sql/sem/tree/datum.go:522–527  ·  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

520// The given width must be 64 or smaller. The results are undefined
521// if n is greater than 64.
522func (d *DBitArray) AsDInt(n uint) *DInt {
523 if n == 0 {
524 n = 64
525 }
526 return NewDInt(DInt(d.BitArray.AsInt64(n)))
527}
528
529// ResolvedType implements the TypedExpr interface.
530func (*DBitArray) ResolvedType() *types.T {

Callers 1

PerformCastFunction · 0.80

Calls 3

NewDIntFunction · 0.85
DIntTypeAlias · 0.85
AsInt64Method · 0.45

Tested by

no test coverage detected