Documentation ¶
Index ¶
- Variables
- func PopCount64(x uint64) uint8
- type Uint128
- func (u Uint128) Add(v Uint128) Uint128
- func (u Uint128) Add64(v uint64) Uint128
- func (u Uint128) And(v Uint128) Uint128
- func (u Uint128) And64(v uint64) Uint128
- func (u Uint128) Big() *big.Int
- func (u Uint128) BinaryStr() string
- func (u Uint128) Cmp(v Uint128) int
- func (u Uint128) Cmp64(v uint64) int
- func (u *Uint128) DecodeRLP(s *rlp.Stream) error
- func (u Uint128) Div(v Uint128) Uint128
- func (u Uint128) Div64(v uint64) Uint128
- func (u *Uint128) EncodeRLP(w io.Writer) error
- func (u Uint128) Equals(v Uint128) bool
- func (u Uint128) Equals64(v uint64) bool
- func (u Uint128) IsZero() bool
- func (u Uint128) Lsh(n uint) (s Uint128)
- func (u Uint128) Mul(v Uint128) Uint128
- func (u Uint128) Mul64(v uint64) Uint128
- func (u Uint128) Or(v Uint128) Uint128
- func (u Uint128) Or64(v uint64) Uint128
- func (u Uint128) PopCount() uint8
- func (u Uint128) PutBytes(b []byte)
- func (u Uint128) QuoRem(v Uint128) (q, r Uint128)
- func (u Uint128) QuoRem64(v uint64) (q Uint128, r uint64)
- func (u Uint128) Rsh(n uint) (s Uint128)
- func (u Uint128) String() string
- func (u Uint128) Sub(v Uint128) Uint128
- func (u Uint128) Sub64(v uint64) Uint128
- func (u Uint128) Xor(v Uint128) Uint128
- func (u Uint128) Xor64(v uint64) Uint128
- type Uint128Temp
Constants ¶
This section is empty.
Variables ¶
View Source
var MaxValue = New(^uint64(0), ^uint64(0))
MaxValue is a max value of uint128.
Functions ¶
func PopCount64 ¶
PopCount64, count how many bits of a binary form corresponding to a uint64 type number are 1
Types ¶
type Uint128 ¶
type Uint128 struct {
// contains filtered or unexported fields
}
A Uint128 is an unsigned 128-bit number.
var Zero Uint128
Zero is a zero-valued uint128.
func FromBig ¶
FromBig converts i to a Uint128 value. It panics if i is negative or overflows 128 bits.
func (Uint128) BinaryStr ¶ added in v1.0.5
String returns the base-2 representation of u as a string.
func (Uint128) Equals ¶
Equals returns true if u == v.
Uint128 values can be compared directly with ==, but use of the Equals method is preferred for consistency.
func (Uint128) PopCount ¶
PopCount, count how many bits of a binary form corresponding to a Uint128 type number are 1
type Uint128Temp ¶ added in v1.0.5
Click to show internal directories.
Click to hide internal directories.