Documentation ¶
Index ¶
- Variables
- type Initialiser
- type Number
- func (i *Number) Add(x, y *Number) *Number
- func (i *Number) Bytes() []byte
- func (i *Number) Cmp(x *Number) int
- func (i *Number) Div(x, y *Number) *Number
- func (i *Number) FirstBitSet() int
- func (i *Number) Int256() *Number
- func (i *Number) Int64() int64
- func (i *Number) Lsh(x *Number, s uint) *Number
- func (i *Number) Mod(x, y *Number) *Number
- func (i *Number) Mul(x, y *Number) *Number
- func (i *Number) Pow(x, y *Number) *Number
- func (i *Number) Set(x *Number) *Number
- func (i *Number) SetBytes(x []byte) *Number
- func (i *Number) String() string
- func (i *Number) Sub(x, y *Number) *Number
- func (i *Number) Uint256() *Number
- func (i *Number) Uint64() uint64
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Initialiser ¶
Number function
func NewInitialiser ¶
func NewInitialiser(limiter func(*Number) *Number) Initialiser
Returns a new initialiser for a new *Number without having to expose certain fields
type Number ¶
type Number struct {
// contains filtered or unexported fields
}
A Number represents a generic integer with a bounding function limiter. Limit is called after each operations to give "fake" bounded integers. New types of Number can be created through NewInitialiser returning a lambda with the new Initialiser.
func (*Number) FirstBitSet ¶
Returns the index of the first bit that's set to 1
Click to show internal directories.
Click to hide internal directories.