bigson

package module
v0.0.0-...-005222f Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cmp

func Cmp(x, y *BigInt) int

Cmp compare x and y and resolve -1 if x < y || 0 if x == y || +1 if x > y

Types

type BigFloat

type BigFloat big.Float

BigFloat is a wrapper over big.Float to implement only unmarshalText for json decoding.

func NewBigFloat

func NewBigFloat(value *big.Float) *BigFloat

NewBigFloat create a new BigFloat from a big.Float

func NewFloat

func NewFloat(value float64) *BigFloat

NewFloat create a new BigFloat from a int

func (*BigFloat) Float

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

Float retreive the big.Float value of a BigFloat object

func (*BigFloat) MarshalBSONValue

func (b *BigFloat) MarshalBSONValue() (bsontype.Type, []byte, error)

MarshalBSONValue implements the bson.ValueMarshaler interface

func (*BigFloat) MarshalText

func (b *BigFloat) MarshalText() (text []byte, err error)

MarshalText implements the text marshal interface

func (*BigFloat) SetString

func (b *BigFloat) SetString(value string) (*BigFloat, bool)

SetString create a new BigFloat from a string

func (*BigFloat) String

func (b *BigFloat) String() string

String return a representation of b as a string

func (*BigFloat) UnmarshalBSONValue

func (b *BigFloat) UnmarshalBSONValue(tpe bsontype.Type, data []byte) error

UnmarshalBSONValue is an interface implemented that can unmarshal a BSON value representation of themselves.

func (*BigFloat) UnmarshalText

func (b *BigFloat) UnmarshalText(text []byte) (err error)

UnmarshalText implements the text Unmarshal interface

type BigInt

type BigInt big.Int

BigInt is a wrapper over big.Int to implement only unmarshalText for json decoding.

func New

func New(value *big.Int) *BigInt

New create a new BigInt from a big.Int

func NewInt

func NewInt(value int64) *BigInt

NewInt create a new BigInt from a int

func SetString

func SetString(value string, base int) (*BigInt, bool)

SetString create a new BigInt from a string

func SetUint64

func SetUint64(value uint64) *BigInt

SetUint64 create a new BigInt from a uint64

func Sub

func Sub(old, new *BigInt) *BigInt

Sub returns the sub of old - new

func Sum

func Sum(old, new *BigInt) *BigInt

Sum returns the sum of old + new

func (*BigInt) Int

func (b *BigInt) Int() *big.Int

Int retreive the big.Int value of a BigInt object

func (*BigInt) MarshalBSONValue

func (b *BigInt) MarshalBSONValue() (bsontype.Type, []byte, error)

MarshalBSONValue implements the bson.ValueMarshaler interface

func (*BigInt) MarshalText

func (b *BigInt) MarshalText() (text []byte, err error)

MarshalText implements the text marshal interface

func (*BigInt) String

func (b *BigInt) String() string

String return a representation of b as a string

func (*BigInt) UnmarshalBSONValue

func (b *BigInt) UnmarshalBSONValue(tpe bsontype.Type, data []byte) error

UnmarshalBSONValue is an interface implemented that can unmarshal a BSON value representation of themselves.

func (*BigInt) UnmarshalText

func (b *BigInt) UnmarshalText(text []byte) (err error)

UnmarshalText implements the text Unmarshal interface

Jump to

Keyboard shortcuts

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