big

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Float

type Float = mb.Float

no need for custom Float, add here to simplify code using both big.Int and Float

func NewFloat

func NewFloat(x float64) *Float

func ParseFloat

func ParseFloat(s string, base int, prec uint, mode mb.RoundingMode) (f *Float, b int, err error)

type Int

type Int struct {
	mb.Int
}

func New

func New(i *mb.Int) *Int

func NewInt

func NewInt(x int64) *Int

func (Int) MarshalJSON

func (i Int) MarshalJSON() ([]byte, error)

MarshalJSON always has quotes

func (*Int) Scan

func (i *Int) Scan(v interface{}) error

for sql scan/value, only support string without quotes

func (Int) ToInt

func (i Int) ToInt() *mb.Int

ToInt returns a new *math/big.Int equal i.Int, to avoid unintentional change if read only, use i.Int directly

func (*Int) UnmarshalJSON

func (i *Int) UnmarshalJSON(p []byte) error

support both quotes and no quotes

func (Int) Value

func (i Int) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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