func (d Decimal) Neg() Decimal {
	return nanGuard(func() Decimal {
		return d.Mul(NewDecimal(-1))
	}, d)
}
Neg returns this Decimal multiplied by -1.
package big
import (
	"database/sql/driver"
	"encoding/json"
	"errors"
	"fmt"
	"math"
	"math/big"
)
var (
	flZero = *big.NewFloat(0)
	NaN = NewDecimal(math.NaN())
	ZERO = NewFromString("0")
	ONE = NewFromString("1")
	TEN = NewFromString("10")
	MarshalQuoted = false
)
type Decimal struct {
	fl *big.Float
}
func NewDecimal(val float64) Decimal {
	var fl *big.Float
	defer func() {
		if r := recover(); r != nil {
			switch r.(type) {
			case big.ErrNaN:
				fl = nil
			}
		}
	}()
	fl = big.NewFloat(val)
	return Decimal{
		fl: fl,
	}
}
func NewFromString(str string) Decimal {
	bfl := big.NewFloat(0)
	if _, _, err := bfl.Parse(str, 10); err != nil {
		return NaN
	}
	return Decimal{bfl}
}
func NewFromInt(dec int) Decimal {
	return Decimal{big.NewFloat(float64(dec))}
}
func MaxSlice(decimals ...Decimal) Decimal {
	if anyNan(decimals...) {
		return NaN
	} else if len(decimals) == 0 {
		return ZERO
	}
	initial := NewFromString("-Inf")
	for _, decimal := range decimals {
		if decimal.GT(initial) {
			initial = decimal
		}
	}
	return initial
}
func MinSlice(decimals ...Decimal) Decimal {
	if anyNan(decimals...) {
		return NaN
	} else if len(decimals) == 0 {
		return ZERO
	}
	initial := NewFromString("Inf")
	for _, decimal := range decimals {
		if decimal.LT(initial) {
			initial = decimal
		}
	}
	return initial
}
func (d Decimal) Add(addend Decimal) Decimal {
	return nanGuard(func() Decimal {
		return Decimal{d.cpy().Add(d.fl, addend.fl)}
	}, d, addend)
}
func (d Decimal) Sub(subtrahend Decimal) Decimal {
	return nanGuard(func() Decimal {
		return Decimal{d.cpy().Sub(d.fl, subtrahend.fl)}
	}, d, subtrahend)
}
func (d Decimal) Mul(factor Decimal) Decimal {
	return nanGuard(func() Decimal {
		return Decimal{d.cpy().Mul(d.fl, factor.fl)}
	}, d, factor)
}
func (d Decimal) Div(denominator Decimal) Decimal {
	return nanGuard(func() Decimal {
		return Decimal{d.cpy().Quo(d.fl, denominator.fl)}
	}, d, denominator)
}
func (d Decimal) Frac(f float64) Decimal {
	fractionFactor := NewDecimal(f)
	return nanGuard(func() Decimal {
		return d.Mul(NewDecimal(f))
	}, d, fractionFactor)
}