Documentation
¶
Index ¶
- type Int128
- type Uint128
- func (u Uint128) AND(m Uint128) Uint128
- func (u Uint128) Add(n Uint128) Uint128
- func (u Uint128) Add64(n uint64) Uint128
- func (u Uint128) AddOne() Uint128
- func (u Uint128) Equals(o Uint128) bool
- func (u Uint128) IsZero() bool
- func (u Uint128) NOT() Uint128
- func (u Uint128) OR(m Uint128) Uint128
- func (u Uint128) Sub64(n uint64) Uint128
- func (u Uint128) SubOne() Uint128
- func (u Uint128) XOR(m Uint128) Uint128
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Uint128 ¶
type Uint128 struct {
// contains filtered or unexported fields
}
Uint128 represents a Uint128 using two uint64s.
When the methods below mention a bit number, bit 0 is the most significant bit (in hi) and bit 127 is the lowest (lo&1).
NOTE: Uint128 is kept as struct instead of array because array of size > 1 doesn't go through SSA, see https://github.com/golang/go/issues/24416
func (Uint128) IsZero ¶
IsZero reports whether u == 0.
It's faster than u == (uint128{}) because the compiler (as of Go 1.15/1.16b1) doesn't do this trick and instead inserts a branch in its eq alg's generated code.
Click to show internal directories.
Click to hide internal directories.