Documentation ¶
Index ¶
- Constants
- Variables
- func Compare(x, y Value) int
- func Count(values []Value, counter Counter) int
- func Equal(x, y Value) bool
- func NegativeTester(value Value) bool
- func Parse(input string) (num int64, numDecimalPoints int, err error)
- func PositiveTester(value Value) bool
- type Ascending
- type Counter
- type Descending
- type Reducer
- type RoundingMode
- type Slice
- type Tester
- type Value
- func Abs(a Value) Value
- func Avg(values []Value) (avg Value)
- func Clamp(x, min, max Value) Value
- func Div(x, y Value) Value
- func Filter(values []Value, f Tester) (slice []Value)
- func Max(a, b Value) Value
- func Min(a, b Value) Value
- func Mul(x, y Value) Value
- func Must(v Value, err error) Value
- func MustNewFromBytes(input []byte) (v Value)
- func MustNewFromString(input string) Value
- func NewFromBytes(input []byte) (Value, error)
- func NewFromFloat(val float64) Value
- func NewFromInt(val int64) Value
- func NewFromString(input string) (Value, error)
- func Reduce(values []Value, reducer Reducer, a ...Value) Value
- func Sum(values []Value) (s Value)
- func SumReducer(prev, curr Value) Value
- func (v Value) Abs() Value
- func (v Value) Add(v2 Value) Value
- func (v *Value) AtomicAdd(v2 Value)
- func (v *Value) AtomicLoad() Value
- func (v Value) Ceil() Value
- func (x Value) Clamp(min, max Value) Value
- func (x Value) Compare(y Value) int
- func (v Value) Div(v2 Value) Value
- func (x Value) Eq(y Value) bool
- func (v Value) Float64() float64
- func (v Value) Floor() Value
- func (v Value) FormatPercentage(prec int) string
- func (v Value) FormatString(prec int) string
- func (v Value) Int() int
- func (v Value) Int64() int64
- func (a Value) IsInf() bool
- func (v Value) IsZero() bool
- func (v Value) MarshalJSON() ([]byte, error)
- func (v Value) MarshalYAML() (interface{}, error)
- func (v Value) Mul(v2 Value) Value
- func (a Value) MulExp(exp int) Value
- func (v Value) Neg() Value
- func (a Value) NumFractionalDigits() int
- func (a Value) NumIntDigits() int
- func (v Value) Percentage() string
- func (v Value) Round(r int, mode RoundingMode) Value
- func (v *Value) Scan(src interface{}) error
- func (v Value) Sign() int
- func (v Value) SignedPercentage() string
- func (v Value) String() string
- func (v Value) Sub(v2 Value) Value
- func (v Value) Trunc() Value
- func (v *Value) UnmarshalJSON(data []byte) error
- func (v *Value) UnmarshalYAML(unmarshal func(a interface{}) error) (err error)
- func (v Value) Value() (driver.Value, error)
Constants ¶
View Source
const DefaultPow = 1e8
View Source
const DefaultPrecision = 8
View Source
const MaxPrecision = 12
View Source
const NegInf = Value(math.MinInt64)
View Source
const NegOne = Value(-1e8)
View Source
const One = Value(1e8)
View Source
const PosInf = Value(math.MaxInt64)
View Source
const Zero = Value(0)
Variables ¶
View Source
var ErrPrecisionLoss = errors.New("precision loss")
Functions ¶
func NegativeTester ¶
func PositiveTester ¶
Types ¶
type Descending ¶
type Descending []Value
func (Descending) Len ¶
func (s Descending) Len() int
func (Descending) Less ¶
func (s Descending) Less(i, j int) bool
func (Descending) Swap ¶
func (s Descending) Swap(i, j int)
type Value ¶
type Value int64
var ( Two Value = NewFromInt(2) Three Value = NewFromInt(3) Four Value = NewFromInt(4) )
func MustNewFromBytes ¶
func MustNewFromString ¶
func NewFromBytes ¶
func NewFromFloat ¶
func NewFromInt ¶
func NewFromString ¶
func SumReducer ¶
func (*Value) AtomicLoad ¶
func (Value) FormatPercentage ¶
func (Value) FormatString ¶
func (Value) MarshalJSON ¶
func (Value) MarshalYAML ¶
func (Value) NumIntDigits ¶
func (Value) Percentage ¶
func (Value) SignedPercentage ¶
func (*Value) UnmarshalJSON ¶
func (*Value) UnmarshalYAML ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.