big

package
v2.12.1-starknet-07192024 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: MIT Imports: 8 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Big

type Big big.Int

Big stores large integers and can deserialize a variety of inputs.

func New

func New(i *big.Int) *Big

New constructs a Big from *big.Int.

func NewI

func NewI(i int64) *Big

NewI constructs a Big from int64.

func (*Big) Add

func (b *Big) Add(c *Big) *Big

Add returns the sum of b and c

func (*Big) Bytes

func (b *Big) Bytes() []byte

Bytes returns the

func (*Big) Cmp

func (b *Big) Cmp(c *Big) int

Cmp compares b and c as big.Ints.

func (*Big) Equal

func (b *Big) Equal(c *Big) bool

Equal returns true if c is equal according to Cmp.

func (*Big) Hex

func (b *Big) Hex() string

Bytes returns the absolute value of b as a big-endian byte slice.

func (*Big) Int64

func (b *Big) Int64() int64

Int64 casts b as an int64 type

func (Big) MarshalJSON

func (b Big) MarshalJSON() ([]byte, error)

MarshalJSON marshals this instance to base 10 number as string.

func (Big) MarshalText

func (b Big) MarshalText() ([]byte, error)

MarshalText marshals this instance to base 10 number as string.

func (*Big) Mod

func (b *Big) Mod(c *Big) *Big

Sub returns b % c

func (*Big) Scan

func (b *Big) Scan(value interface{}) error

Scan reads the database value and returns an instance.

func (*Big) String

func (b *Big) String() string

String returns the base 10 encoding of b.

func (*Big) Sub

func (b *Big) Sub(c *Big) *Big

Sub returns the differencs between b and c

func (*Big) ToInt

func (b *Big) ToInt() *big.Int

ToInt converts b to a big.Int.

func (*Big) UnmarshalJSON

func (b *Big) UnmarshalJSON(input []byte) error

UnmarshalJSON implements encoding.JSONUnmarshaler.

func (*Big) UnmarshalText

func (b *Big) UnmarshalText(input []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (Big) Value

func (b Big) Value() (driver.Value, error)

Value returns this instance serialized for database storage.

type BigFloat

type BigFloat big.Float

BigFloat accepts both string and float JSON values.

func (BigFloat) MarshalJSON

func (b BigFloat) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*BigFloat) UnmarshalJSON

func (b *BigFloat) UnmarshalJSON(buf []byte) error

UnmarshalJSON implements the json.Unmarshal interface.

func (*BigFloat) Value

func (b *BigFloat) Value() *big.Float

Value returns the big.Float value.

Jump to

Keyboard shortcuts

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