package intutils

const MaxUint = ^uint(0)
const MinUint = 0
const MaxInt = int(MaxUint >> 1)
const MinInt = -MaxInt - 1

var sizeTable = []int{9, 99, 999, 9999, 99999, 999999, 9999999,
	99999999, 999999999, MaxInt}

func IntSize(x int) int {
	for i := 0; ; i++ {
		if x <= sizeTable[i] {
			return i + 1
		}
	}
}
