func (r *Rat) IsLessOrEqual(g interface{}) bool {
	y := toRat(g, nil)
	if y == nil {
		return false
	}
	return r.Cmp(&y.Rat) <= 0
}
IsLessOrEqual will return true if `r <= g`.
package big
import (
	"bytes"
	"database/sql/driver"
	"fmt"
	"log"
	"math/big"
	"strconv"
	"strings"
	"github.com/shuLhan/share/lib/runes"
)
var ratZero = NewRat(0)
type Rat struct {
	big.Rat
}
func AddRat(f ...interface{}) *Rat {
	if len(f) == 0 {
		return nil
	}
	total := NewRat(f[0])
	if total == nil {
		return nil
	}
	for x := 1; x < len(f); x++ {
		rx := toRat(f[x], nil)
		if rx == nil {
			continue
		}
		total.Add(rx)
	}
	return total
}
func NewRat(v interface{}) (r *Rat) {
	r = &Rat{}
	got := toRat(v, r)
	if got == nil {
		return nil
	}
	return r
}
func MulRat(f ...interface{}) *Rat {
	if len(f) == 0 {
		return nil
	}
	total := NewRat(f[0])
	if total == nil {
		return nil
	}
	for x := 1; x < len(f); x++ {
		rx := toRat(f[x], nil)
		if rx == nil {
			continue
		}
		total.Mul(rx)
	}
	return total
}
func MustRat(v interface{}) (r *Rat) {
	r = NewRat(v)
	if r == nil {
		log.Fatalf("MustRat: cannot convert %v to Rat", v)
	}
	return r
}
func QuoRat(f ...interface{}) *Rat {
	if len(f) == 0 {
		return nil
	}
	total := NewRat(f[0])
	if total == nil {
		return nil
	}
	for x := 1; x < len(f); x++ {
		rx := toRat(f[x], nil)
		if rx == nil {
			continue
		}
		total.Quo(rx)
	}
	return total
}
func SubRat(f ...interface{}) *Rat {
	if len(f) == 0 {
		return nil
	}
	total := NewRat(f[0])
	if total == nil {
		return nil
	}
	for x := 1; x < len(f); x++ {
		rx := toRat(f[x], nil)
		if rx == nil {
			continue
		}
		total.Sub(rx)
	}
	return total
}
func (r *Rat) Abs() *Rat {
	r.Rat.Abs(&r.Rat)
	return r
}
func (r *Rat) Add(g interface{}) *Rat {
	y := toRat(g, nil)
	if y == nil {
		return r
	}
	r.Rat.Add(&r.Rat, &y.Rat)
	return r
}
func (r *Rat) Humanize(thousandSep, decimalSep string) string {
	var (
		raw     = r.String()
		parts   = strings.SplitN(raw, ".", 2)
		intPart = []rune(parts[0])
		out     = make([]rune, 0, len(intPart)+(len(intPart)/3))
		i       = 0
	)
	for x := len(intPart) - 1; x >= 0; x-- {
		if i%3 == 0 && len(out) > 0 {
			out = append(out, []rune(thousandSep)...)
		}
		out = append(out, intPart[x])
		i++
	}
	out = runes.Inverse(out)
	if len(parts) == 2 {
		out = append(out, []rune(decimalSep)...)
		out = append(out, []rune(parts[1])...)
	}
	return string(out)
}
func (r *Rat) Int64() int64 {
	s := strings.Split(r.String(), ".")[0]
	i64, _ := strconv.ParseInt(s, 10, 64)
	return i64
}
func (r *Rat) IsEqual(g interface{}) bool {
	y := toRat(g, nil)
	if y == nil {
		return r == nil
	}
	if r == nil {
		return false
	}
	if r.Cmp(&y.Rat) == 0 {
		return true
	}
	if r.String() == y.String() {
		return true
	}
	return false
}
func (r *Rat) IsGreater(g interface{}) bool {
	y := toRat(g, nil)
	if y == nil {
		return false
	}
	return r.Cmp(&y.Rat) > 0
}
func (r *Rat) IsGreaterOrEqual(g interface{}) bool {
	y := toRat(g, nil)
	if y == nil {
		return false
	}
	return r.Cmp(&y.Rat) >= 0
}
func (r *Rat) IsGreaterThanZero() bool {
	if r == nil {
		return false
	}
	return r.Cmp(&ratZero.Rat) > 0
}
func (r *Rat) IsLess(g interface{}) bool {
	y := toRat(g, nil)
	if y == nil {
		return false
	}
	return r.Cmp(&y.Rat) < 0
}