func (c NumberArrayCollection) Diff(m interface{}) Collection {
	ms := newDecimalArray(m)
	var d = make([]decimal.Decimal, 0)
	for _, value := range c.value {
		exist := false
		for i := 0; i < len(ms); i++ {
			if ms[i].Equal(value) {
				exist = true
				break
			}
		}
		if !exist {
			d = append(d, value)
		}
	}
	return NumberArrayCollection{
		value: d,
	}
}
Diff compares the collection against another collection or a plain PHP array based on its values.
This method will return the values in the original collection that are not present in the given collection.
package collection
import (
	"encoding/json"
	"github.com/shopspring/decimal"
	"math"
	"math/rand"
	"time"
)
type NumberArrayCollection struct {
	value []decimal.Decimal
	BaseCollection
}
func (c NumberArrayCollection) Sum(key ...string) decimal.Decimal {
	var sum = decimal.New(0, 0)
	for i := 0; i < len(c.value); i++ {
		sum = sum.Add(c.value[i])
	}
	return sum
}
func (c NumberArrayCollection) Length() int {
	return len(c.value)
}
func (c NumberArrayCollection) Avg(key ...string) decimal.Decimal {
	var sum = decimal.New(0, 0)
	for i := 0; i < len(c.value); i++ {
		sum = sum.Add(c.value[i])
	}
	return sum.Div(nd(len(c.value)))
}
func (c NumberArrayCollection) Min(key ...string) decimal.Decimal {
	var smallest = decimal.New(0, 0)
	for i := 0; i < len(c.value); i++ {
		if i == 0 {
			smallest = c.value[i]
			continue
		}
		if smallest.GreaterThan(c.value[i]) {
			smallest = c.value[i]
		}
	}
	return smallest
}
func (c NumberArrayCollection) Max(key ...string) decimal.Decimal {
	var biggest = decimal.New(0, 0)
	for i := 0; i < len(c.value); i++ {
		if i == 0 {
			biggest = c.value[i]
			continue
		}
		if biggest.LessThan(c.value[i]) {
			biggest = c.value[i]
		}
	}
	return biggest
}
func (c NumberArrayCollection) Prepend(values ...interface{}) Collection {
	var d NumberArrayCollection
	var n = make([]decimal.Decimal, len(c.value))
	copy(n, c.value)
	d.value = append([]decimal.Decimal{newDecimalFromInterface(values[0])}, n...)
	d.length = len(d.value)
	return d
}
func (c NumberArrayCollection) Splice(index ...int) Collection {
	if len(index) == 1 {
		var n = make([]decimal.Decimal, len(c.value))
		copy(n, c.value)
		n = n[index[0]:]
		return NumberArrayCollection{n, BaseCollection{length: len(n)}}
	} else if len(index) > 1 {
		var n = make([]decimal.Decimal, len(c.value))
		copy(n, c.value)
		n = n[index[0] : index[0]+index[1]]
		return NumberArrayCollection{n, BaseCollection{length: len(n)}}
	} else {
		panic("invalid argument")
	}
}
func (c NumberArrayCollection) Take(num int) Collection {
	var d NumberArrayCollection
	if num > c.length {
		panic("not enough elements to take")
	}
	if num >= 0 {
		d.value = c.value[:num]
		d.length = num
	} else {
		d.value = c.value[len(c.value)+num:]
		d.length = 0 - num
	}
	return d
}
func (c NumberArrayCollection) All() []interface{} {
	s := make([]interface{}, len(c.value))
	for i := 0; i < len(c.value); i++ {
		s[i] = c.value[i]
	}
	return s
}
func (c NumberArrayCollection) Mode(key ...string) []interface{} {
	valueCount := c.CountBy()
	maxCount := 0
	maxValue := make([]interface{}, len(valueCount))
	for v, c := range valueCount {
		switch {
		case c < maxCount:
			continue
		case c == maxCount:
			maxValue = append(maxValue, newDecimalFromInterface(v))
		case c > maxCount:
			maxValue = append([]interface{}{}, newDecimalFromInterface(v))
			maxCount = c
		}
	}
	return maxValue
}
func (c NumberArrayCollection) ToNumberArray() []decimal.Decimal {
	return c.value
}
func (c NumberArrayCollection) ToIntArray() []int {
	var v = make([]int, len(c.value))
	for i, value := range c.value {
		v[i] = int(value.IntPart())
	}
	return v
}
func (c NumberArrayCollection) ToInt64Array() []int64 {
	var v = make([]int64, len(c.value))
	for i, value := range c.value {
		v[i] = value.IntPart()
	}
	return v
}
func (c NumberArrayCollection) Chunk(num int) MultiDimensionalArrayCollection {
	var d MultiDimensionalArrayCollection
	d.length = c.length/num + 1
	d.value = make([][]interface{}, d.length)
	count := 0
	for i := 1; i <= c.length; i++ {
		switch {
		case i == c.length:
			if i%num == 0 {
				d.value[count] = c.All()[i-num:]
				d.value = d.value[:d.length-1]
			} else {
				d.value[count] = c.All()[i-i%num:]
			}
		case i%num != 0 || i < num:
			continue
		default:
			d.value[count] = c.All()[i-num : i]
			count++
		}
	}
	return d
}
func (c NumberArrayCollection) Concat(value interface{}) Collection {
	return NumberArrayCollection{
		value:          append(c.value, value.([]decimal.Decimal)...),
		BaseCollection: BaseCollection{length: c.length + len(value.([]decimal.Decimal))},
	}
}
func (c NumberArrayCollection) Contains(value ...interface{}) bool {
	if callback, ok := value[0].(CB); ok {
		for k, v := range c.value {
			if callback(k, v) {
				return true
			}
		}
		return false
	}
	for _, v := range c.value {
		if v.Equal(nd(value[0])) {
			return true
		}
	}
	return false
}
func (c NumberArrayCollection) CountBy(callback ...interface{}) map[interface{}]int {
	valueCount := make(map[interface{}]int)
	if len(callback) > 0 {
		if cb, ok := callback[0].(FilterFun); ok {
			for _, v := range c.value {
				valueCount[cb(v)]++
			}
		}
	} else {
		for _, v := range c.value {
			vv, _ := v.Float64()
			valueCount[vv]++
		}
	}
	return valueCount
}
func (c NumberArrayCollection) CrossJoin(array ...[]interface{}) MultiDimensionalArrayCollection {
	var d MultiDimensionalArrayCollection
	length := len(c.value)
	for _, s := range array {
		length *= len(s)
	}
	value := make([][]interface{}, length)
	for i := range value {
		value[i] = make([]interface{}, len(array)+1)
	}
	offset := length / c.length
	for i := 0; i < length; i++ {
		value[i][0] = c.value[i/offset]
	}
	assignmentToValue(value, array, length, 1, 0, offset)
	d.value = value
	d.length = length
	return d
}
func (c NumberArrayCollection) Dd() {
	dd(c)
}
func (c NumberArrayCollection) Dump() {
	dump(c)
}