func (x Target) Inverse() *big.Rat {
	return new(big.Rat).Inv(x.Rat())
}
Inverse returns the inverse of a Target as a big.Rat
package types
import (
	"errors"
	"math/big"
	"github.com/NebulousLabs/Sia/build"
	"github.com/NebulousLabs/Sia/crypto"
)
type (
	Target crypto.Hash
)
var (
	ErrNegativeTarget = errors.New("negative value used when converting to target")
)
func (x Target) AddDifficulties(y Target) (t Target) {
	sumDifficulty := new(big.Rat).Add(x.Inverse(), y.Inverse())
	return RatToTarget(new(big.Rat).Inv(sumDifficulty))
}
func (x Target) Cmp(y Target) int {
	return x.Int().Cmp(y.Int())
}
func (x Target) Difficulty() Currency {
	if x == (Target{}) {
		return NewCurrency(RootDepth.Int())
	}
	return NewCurrency(new(big.Int).Div(RootDepth.Int(), x.Int()))
}
func (x Target) Int() *big.Int {
	return new(big.Int).SetBytes(x[:])
}
func IntToTarget(i *big.Int) (t Target) {
	if i.Sign() < 0 {
		if build.DEBUG {
			panic(ErrNegativeTarget)
		}
	} else {
		if i.BitLen() > 256 {
			return RootDepth
		}
		b := i.Bytes()
		offset := len(t[:]) - len(b)
		copy(t[offset:], b)
	}
	return
}