package puddle

import 

type ints interface {
	int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64
}

// log2Int returns log2 of an integer. This function panics if val < 0. For val
// == 0, returns 0.
func [ ints]( ) uint8 {
	if  <= 0 {
		panic("log2 of non-positive number does not exist")
	}

	return log2IntRange(, 0, uint8(8*unsafe.Sizeof()))
}

func [ ints]( , ,  uint8) uint8 {
	 :=  - 
	if  == 1 {
		return 
	}

	 :=  + /2
	 := (1) << 
	if  >  {
		return (, , )
	} else {
		return (, , )
	}
}