gitlab.com/evatix-go/core@v1.3.55/coremath/integer64OutOfRange.go (about)

     1  package coremath
     2  
     3  import (
     4  	"math"
     5  
     6  	"gitlab.com/evatix-go/core/constants"
     7  )
     8  
     9  type integer64OutOfRange struct{}
    10  
    11  func (it integer64OutOfRange) Byte(value int64) bool {
    12  	return !(value >= 0 && value <= 255)
    13  }
    14  
    15  func (it integer64OutOfRange) UnsignedInt16(value int64) bool {
    16  	return !(value >= 0 && value <= int64(math.MaxUint16))
    17  }
    18  
    19  func (it integer64OutOfRange) UnsignedInt32(value int64) bool {
    20  	return !(value >= 0 && value <= int64(math.MaxUint32))
    21  }
    22  
    23  func (it integer64OutOfRange) UnsignedInt64(value int64) bool {
    24  	return !(value >= 0)
    25  }
    26  
    27  func (it integer64OutOfRange) Int8(value int64) bool {
    28  	return !(value >= int64(math.MinInt8) && value <= int64(math.MaxInt8))
    29  }
    30  
    31  func (it integer64OutOfRange) Int16(value int64) bool {
    32  	return !(value >= int64(math.MinInt16) && value <= int64(math.MaxInt16))
    33  }
    34  
    35  func (it integer64OutOfRange) Int32(value int64) bool {
    36  	return !(value >= int64(math.MinInt32) && value <= int64(math.MaxInt32))
    37  }
    38  
    39  func (it integer64OutOfRange) Int(value int64) bool {
    40  	return !(value >= int64(constants.MinInt) && value <= int64(constants.MaxInt))
    41  }