Documentation ¶
Index ¶
- Variables
- type BigNumber
- 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 BigNumber ¶
BigNumber marshals/unmarshals as a JSON string with plain number inside. There are quotes around the number. The zero value marshals as "0". Negative integers are supported. Use it whileu providing JSON APIs since some of the clients does not support parsing very long plain integers.
func (*BigNumber) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*BigNumber) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
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