func (x *Dec) Cmp(y *Dec) int {
	xx, yy := upscale(x, y)
	return xx.UnscaledBig().Cmp(yy.UnscaledBig())
}
Cmp compares x and y and returns:

-1 if x <  y
0 if x == y
+1 if x >  y
package inf  
import (
	"fmt"
	"io"
	"math/big"
	"strings"
)
type Dec struct {
	unscaled big.Int
	scale    Scale
}
type Scale int32
const scaleSize = 4  
type scaler interface {
	Scale(x *Dec, y *Dec) Scale
}
var bigInt = [...]*big.Int{
	big.NewInt(0), big.NewInt(1), big.NewInt(2), big.NewInt(3), big.NewInt(4),
	big.NewInt(5), big.NewInt(6), big.NewInt(7), big.NewInt(8), big.NewInt(9),
	big.NewInt(10),
}
var exp10cache [64]big.Int = func() [64]big.Int {
	e10, e10i := [64]big.Int{}, bigInt[1]
	for i, _ := range e10 {
		e10[i].Set(e10i)
		e10i = new(big.Int).Mul(e10i, bigInt[10])
	}
	return e10
}()
func NewDec(unscaled int64, scale Scale) *Dec {
	return new(Dec).SetUnscaled(unscaled).SetScale(scale)
}
func NewDecBig(unscaled *big.Int, scale Scale) *Dec {
	return new(Dec).SetUnscaledBig(unscaled).SetScale(scale)
}
func (x *Dec) Scale() Scale {
	return x.scale
}
func (x *Dec) Unscaled() (u int64, ok bool) {
	u = x.unscaled.Int64()
	var i big.Int
	ok = i.SetInt64(u).Cmp(&x.unscaled) == 0
	return
}
func (x *Dec) UnscaledBig() *big.Int {
	return &x.unscaled
}
func (z *Dec) SetScale(scale Scale) *Dec {
	z.scale = scale
	return z
}
func (z *Dec) SetUnscaled(unscaled int64) *Dec {
	z.unscaled.SetInt64(unscaled)
	return z
}
func (z *Dec) SetUnscaledBig(unscaled *big.Int) *Dec {
	z.unscaled.Set(unscaled)
	return z
}
func (z *Dec) Set(x *Dec) *Dec {
	if z != x {
		z.SetUnscaledBig(x.UnscaledBig())
		z.SetScale(x.Scale())
	}
	return z
}
func (x *Dec) Sign() int {
	return x.UnscaledBig().Sign()
}
func (z *Dec) Neg(x *Dec) *Dec {
	z.SetScale(x.Scale())
	z.UnscaledBig().Neg(x.UnscaledBig())
	return z
}