math

package
v0.7.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2019 License: LGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BigOne = big.NewInt(1)
	P128   = new(big.Int).SetBit(new(big.Int), 128, 1)
	MOD128 = new(big.Int).Sub(P128, BigOne)
	P256   = new(big.Int).SetBit(new(big.Int), 256, 1)
	MOD256 = new(big.Int).Sub(P256, BigOne)
)

Functions

This section is empty.

Types

type Uint128

type Uint128 struct {
	// contains filtered or unexported fields
}

func NewUint128FromBigInt

func NewUint128FromBigInt(data *big.Int) *Uint128

func NewUint128FromBytes

func NewUint128FromBytes(data []byte) *Uint128

func NewUint128FromHexString

func NewUint128FromHexString(data string) *Uint128

func NewUint128FromString

func NewUint128FromString(data string, base int) *Uint128

func NewUint128FromUint128

func NewUint128FromUint128(data *Uint128) *Uint128

func (*Uint128) Add

func (ui128 *Uint128) Add(y *Uint128) bool

func (*Uint128) BitLen

func (ui128 *Uint128) BitLen() int

func (*Uint128) Div

func (ui128 *Uint128) Div(y *Uint128) bool

func (*Uint128) MarshalJSON

func (ui128 *Uint128) MarshalJSON() ([]byte, error)

func (*Uint128) Mul

func (ui128 *Uint128) Mul(y *Uint128) bool

func (*Uint128) String

func (ui128 *Uint128) String() string

func (*Uint128) Sub

func (ui128 *Uint128) Sub(y *Uint128) bool

func (*Uint128) UnmarshalJSON

func (ui128 *Uint128) UnmarshalJSON(byteJson []byte) (err error)

type Uint256

type Uint256 struct {
	// contains filtered or unexported fields
}

func AddUint256

func AddUint256(x *Uint256, y *Uint256) (ret *Uint256, check bool)

func DivUint256

func DivUint256(x *Uint256, y *Uint256) (ret *Uint256, check bool)

func MulUint256

func MulUint256(x *Uint256, y *Uint256) (ret *Uint256, check bool)

func NewUint256FromBigInt

func NewUint256FromBigInt(data *big.Int) *Uint256

func NewUint256FromBytes

func NewUint256FromBytes(data []byte) *Uint256

func NewUint256FromHexString

func NewUint256FromHexString(data string) *Uint256

func NewUint256FromString

func NewUint256FromString(data string, base int) *Uint256

func NewUint256FromUint256

func NewUint256FromUint256(data *Uint256) *Uint256

func SubUint256

func SubUint256(x *Uint256, y *Uint256) (ret *Uint256, check bool)

func (*Uint256) Add

func (ui256 *Uint256) Add(y *Uint256) bool

func (*Uint256) BitLen

func (ui256 *Uint256) BitLen() int

func (*Uint256) Bytes

func (ui256 *Uint256) Bytes() []byte

func (*Uint256) Comp

func (ui256 *Uint256) Comp(y *Uint256) int

func (*Uint256) Div

func (ui256 *Uint256) Div(y *Uint256) bool

func (*Uint256) MarshalJSON

func (ui256 *Uint256) MarshalJSON() ([]byte, error)

func (*Uint256) Mul

func (ui256 *Uint256) Mul(y *Uint256) bool

func (*Uint256) String

func (ui256 *Uint256) String() string

func (*Uint256) Sub

func (ui256 *Uint256) Sub(y *Uint256) bool

func (*Uint256) UnmarshalJSON

func (ui256 *Uint256) UnmarshalJSON(byteJson []byte) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL