github.com/muhammadn/cortex@v1.9.1-0.20220510110439-46bb7000d03d/pkg/util/math/math.go (about)

     1  package math
     2  
     3  // Max returns the maximum of two ints
     4  func Max(a, b int) int {
     5  	if a > b {
     6  		return a
     7  	}
     8  	return b
     9  }
    10  
    11  // Min returns the minimum of two ints
    12  func Min(a, b int) int {
    13  	if a < b {
    14  		return a
    15  	}
    16  	return b
    17  }
    18  
    19  // Max64 returns the maximum of two int64s
    20  func Max64(a, b int64) int64 {
    21  	if a > b {
    22  		return a
    23  	}
    24  	return b
    25  }
    26  
    27  // Min64 returns the minimum of two int64s
    28  func Min64(a, b int64) int64 {
    29  	if a < b {
    30  		return a
    31  	}
    32  	return b
    33  }