number

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FloatFloatCompare

func FloatFloatCompare(op string, a big.Float, b big.Float) bool

func GetAsInt

func GetAsInt(a Number) (int64, bool)

func IntIntCompare

func IntIntCompare(op string, a big.Int, b big.Int) bool

func IsFloat

func IsFloat(inp string) bool

Types

type FloatNumber

type FloatNumber struct {
	Value big.Float
}

func (*FloatNumber) String

func (f *FloatNumber) String() string

func (*FloatNumber) Type

func (f *FloatNumber) Type() NumberType

type IntNumber

type IntNumber struct {
	Value big.Int
}

func (*IntNumber) String

func (i *IntNumber) String() string

func (*IntNumber) Type

func (i *IntNumber) Type() NumberType

type Num

type Num interface {
	String() string
	Type() NumberType
}

type Number

type Number struct {
	Value Num
	IsInt bool
}

func MakeFloat

func MakeFloat(a float64) Number

func MakeInt

func MakeInt(a int64) Number

func MakeNeg

func MakeNeg(a Number) Number

func NumberOperation

func NumberOperation(op string, n Number, x Number) (Number, bool, bool)

func (*Number) GetType

func (n *Number) GetType() string

func (*Number) SetValue

func (n *Number) SetValue(v string) bool

type NumberType

type NumberType string

Jump to

Keyboard shortcuts

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