gitlab.com/evatix-go/core@v1.3.55/coremath/integer16Within.go (about) 1 package coremath 2 3 import ( 4 "math" 5 ) 6 7 type integer16Within struct{} 8 9 func (it integer16Within) ToByte(value int16) bool { 10 return value >= 0 && value <= 255 11 } 12 13 func (it integer16Within) ToUnsignedInt16(value int16) bool { 14 return value >= 0 15 } 16 17 func (it integer16Within) ToUnsignedInt32(value int16) bool { 18 return value >= 0 19 } 20 21 func (it integer16Within) ToUnsignedInt64(value int16) bool { 22 return value >= 0 23 } 24 25 func (it integer16Within) ToInt8(value int16) bool { 26 return value >= math.MinInt8 && value <= math.MaxInt8 27 }