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)
| 520 | // The given width must be 64 or smaller. The results are undefined |
| 521 | // if n is greater than 64. |
| 522 | func (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. |
| 530 | func (*DBitArray) ResolvedType() *types.T { |
no test coverage detected