Versions in this module Expand all Collapse all v0 v0.0.1 May 4, 2024 Changes in this version + const DefaultPow + const DefaultPrecision + const MaxPrecision + const NegInf + const NegOne + const One + const PosInf + const Zero + var ErrPrecisionLoss = errors.New("precision loss") + 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 []Value + func (s Ascending) Len() int + func (s Ascending) Less(i, j int) bool + func (s Ascending) Swap(i, j int) + type Counter func(a Value) bool + type Descending []Value + func (s Descending) Len() int + func (s Descending) Less(i, j int) bool + func (s Descending) Swap(i, j int) + type Reducer func(prev, curr Value) Value + type RoundingMode int + const Down + const HalfUp + const Up + type Slice []Value + func (s Slice) Len() int + func (s Slice) Less(i, j int) bool + func (s Slice) Reduce(reducer Reducer, a ...Value) Value + func (s Slice) Swap(i, j int) + type Tester func(value Value) bool + type Value int64 + var Four Value = NewFromInt(4) + var Three Value = NewFromInt(3) + var Two Value = NewFromInt(2) + 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 (a Value) IsInf() bool + func (a Value) MulExp(exp int) Value + func (a Value) NumFractionalDigits() int + func (a Value) NumIntDigits() int + func (v *Value) AtomicAdd(v2 Value) + func (v *Value) AtomicLoad() Value + func (v *Value) Scan(src interface{}) error + func (v *Value) UnmarshalJSON(data []byte) error + func (v *Value) UnmarshalYAML(unmarshal func(a interface{}) error) (err error) + func (v Value) Abs() Value + func (v Value) Add(v2 Value) Value + func (v Value) Ceil() Value + func (v Value) Div(v2 Value) Value + 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 (v Value) IsZero() bool + func (v Value) MarshalJSON() ([]byte, error) + func (v Value) MarshalYAML() (interface{}, error) + func (v Value) Mul(v2 Value) Value + func (v Value) Neg() Value + func (v Value) Percentage() string + func (v Value) Round(r int, mode RoundingMode) Value + 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) Value() (driver.Value, error) + func (x Value) Clamp(min, max Value) Value + func (x Value) Compare(y Value) int + func (x Value) Eq(y Value) bool