Versions in this module Expand all Collapse all v1 v1.1.0 Jul 27, 2018 v1.0.0 Sep 12, 2017 Changes in this version + const DefaultTraps + const MaxExponent + const MinExponent + const Round05Up + const RoundCeiling + const RoundDown + const RoundFloor + const RoundHalfDown + const RoundHalfEven + const RoundHalfUp + const RoundUp + var BaseContext = Context + var Roundings = map[string]Rounder + func NewFromString(s string) (*Decimal, Condition, error) + func NumDigits(b *big.Int) int64 + type Condition uint32 + const Clamped + const DivisionByZero + const DivisionImpossible + const DivisionUndefined + const Inexact + const InvalidOperation + const Overflow + const Rounded + const Subnormal + const SystemOverflow + const SystemUnderflow + const Underflow + func (r Condition) Any() bool + func (r Condition) Clamped() bool + func (r Condition) DivisionByZero() bool + func (r Condition) DivisionImpossible() bool + func (r Condition) DivisionUndefined() bool + func (r Condition) GoError(traps Condition) (Condition, error) + func (r Condition) Inexact() bool + func (r Condition) InvalidOperation() bool + func (r Condition) Overflow() bool + func (r Condition) Rounded() bool + func (r Condition) String() string + func (r Condition) Subnormal() bool + func (r Condition) SystemOverflow() bool + func (r Condition) SystemUnderflow() bool + func (r Condition) Underflow() bool + type Context struct + MaxExponent int32 + MinExponent int32 + Precision uint32 + Rounding string + Traps Condition + func (c *Context) Abs(d, x *Decimal) (Condition, error) + func (c *Context) Add(d, x, y *Decimal) (Condition, error) + func (c *Context) Cbrt(d, x *Decimal) (Condition, error) + func (c *Context) Ceil(d, x *Decimal) (Condition, error) + func (c *Context) Cmp(d, x, y *Decimal) (Condition, error) + func (c *Context) Exp(d, x *Decimal) (Condition, error) + func (c *Context) Floor(d, x *Decimal) (Condition, error) + func (c *Context) Ln(d, x *Decimal) (Condition, error) + func (c *Context) Log10(d, x *Decimal) (Condition, error) + func (c *Context) Mul(d, x, y *Decimal) (Condition, error) + func (c *Context) Neg(d, x *Decimal) (Condition, error) + func (c *Context) NewFromString(s string) (*Decimal, Condition, error) + func (c *Context) Pow(d, x, y *Decimal) (Condition, error) + func (c *Context) Quantize(d, x *Decimal, exp int32) (Condition, error) + func (c *Context) Quo(d, x, y *Decimal) (Condition, error) + func (c *Context) QuoInteger(d, x, y *Decimal) (Condition, error) + func (c *Context) Reduce(d, x *Decimal) (int, Condition, error) + func (c *Context) Rem(d, x, y *Decimal) (Condition, error) + func (c *Context) Round(d, x *Decimal) (Condition, error) + func (c *Context) RoundToIntegralExact(d, x *Decimal) (Condition, error) + func (c *Context) RoundToIntegralValue(d, x *Decimal) (Condition, error) + func (c *Context) SetString(d *Decimal, s string) (*Decimal, Condition, error) + func (c *Context) Sqrt(d, x *Decimal) (Condition, error) + func (c *Context) Sub(d, x, y *Decimal) (Condition, error) + func (c *Context) WithPrecision(p uint32) *Context + type Decimal struct + Coeff big.Int + Exponent int32 + Form Form + Negative bool + func New(coeff int64, exponent int32) *Decimal + func NewWithBigInt(coeff *big.Int, exponent int32) *Decimal + func (d *Decimal) Abs(x *Decimal) *Decimal + func (d *Decimal) Append(buf []byte, fmt byte) []byte + func (d *Decimal) Cmp(x *Decimal) int + func (d *Decimal) CmpTotal(x *Decimal) int + func (d *Decimal) Float64() (float64, error) + func (d *Decimal) Format(s fmt.State, format rune) + func (d *Decimal) Int64() (int64, error) + func (d *Decimal) IsZero() bool + func (d *Decimal) MarshalText() ([]byte, error) + func (d *Decimal) Modf(integ, frac *Decimal) + func (d *Decimal) Neg(x *Decimal) *Decimal + func (d *Decimal) NumDigits() int64 + func (d *Decimal) Reduce(x *Decimal) (*Decimal, int) + func (d *Decimal) Scan(src interface{}) error + func (d *Decimal) Set(x *Decimal) *Decimal + func (d *Decimal) SetCoefficient(x int64) *Decimal + func (d *Decimal) SetExponent(x int32) *Decimal + func (d *Decimal) SetFloat64(f float64) (*Decimal, error) + func (d *Decimal) SetInt64(x int64) *Decimal + func (d *Decimal) SetString(s string) (*Decimal, Condition, error) + func (d *Decimal) Sign() int + func (d *Decimal) String() string + func (d *Decimal) Text(format byte) string + func (d *Decimal) UnmarshalText(b []byte) error + func (d Decimal) Value() (driver.Value, error) + type ErrDecimal struct + Ctx *Context + Flags Condition + func MakeErrDecimal(c *Context) ErrDecimal + func (e *ErrDecimal) Abs(d, x *Decimal) *Decimal + func (e *ErrDecimal) Add(d, x, y *Decimal) *Decimal + func (e *ErrDecimal) Ceil(d, x *Decimal) *Decimal + func (e *ErrDecimal) Err() error + func (e *ErrDecimal) Exp(d, x *Decimal) *Decimal + func (e *ErrDecimal) Floor(d, x *Decimal) *Decimal + func (e *ErrDecimal) Int64(d *Decimal) int64 + func (e *ErrDecimal) Ln(d, x *Decimal) *Decimal + func (e *ErrDecimal) Log10(d, x *Decimal) *Decimal + func (e *ErrDecimal) Mul(d, x, y *Decimal) *Decimal + func (e *ErrDecimal) Neg(d, x *Decimal) *Decimal + func (e *ErrDecimal) Pow(d, x, y *Decimal) *Decimal + func (e *ErrDecimal) Quantize(d, v *Decimal, exp int32) *Decimal + func (e *ErrDecimal) Quo(d, x, y *Decimal) *Decimal + func (e *ErrDecimal) QuoInteger(d, x, y *Decimal) *Decimal + func (e *ErrDecimal) Reduce(d, x *Decimal) (int, *Decimal) + func (e *ErrDecimal) Rem(d, x, y *Decimal) *Decimal + func (e *ErrDecimal) Round(d, x *Decimal) *Decimal + func (e *ErrDecimal) RoundToIntegralExact(d, x *Decimal) *Decimal + func (e *ErrDecimal) RoundToIntegralValue(d, x *Decimal) *Decimal + func (e *ErrDecimal) Sqrt(d, x *Decimal) *Decimal + func (e *ErrDecimal) Sub(d, x, y *Decimal) *Decimal + type Form int + const Finite + const Infinite + const NaN + const NaNSignaling + func (i Form) String() string + type NullDecimal struct + Decimal Decimal + Valid bool + func (nd *NullDecimal) Scan(value interface{}) error + func (nd NullDecimal) Value() (driver.Value, error) + type Rounder func(result *big.Int, neg bool, half int) bool + func (r Rounder) Round(c *Context, d, x *Decimal) Condition