



'''simple docstring'''

def 				a  (     UpperCamelCase_    :    int      ,					UpperCamelCase_    :    int			)       ->	Optional[int]:
		if b == 0:
				return 1
		if (b % 2) == 0:
				return actual_power(UpperCamelCase_      ,					int(b / 2			)			) * actual_power(UpperCamelCase_      ,					int(b / 2			)			)
		else:
				return a * actual_power(UpperCamelCase_      ,					int(b / 2			)			) * actual_power(UpperCamelCase_      ,					int(b / 2			)			)






def 				a  (     UpperCamelCase_    :    int      ,					UpperCamelCase_    :    int			)       ->	float:
		if b < 0:
				return 1 / actual_power(UpperCamelCase_      ,					UpperCamelCase_			)
		return actual_power(UpperCamelCase_      ,					UpperCamelCase_			)


if __name__ == "__main__":
			print(power(-2, -3))









'''simple docstring'''

from timeit import timeit






def 				a  (     UpperCamelCase_    :    int			)       ->	int:
		if number < 0:
				raise ValueError('the value of input must not be negative'			)
		snake_case__	     =0
		while number:
				number &= number - 1
				result += 1
		return result






def 				a  (     UpperCamelCase_    :    int			)       ->	int:
		if number < 0:
				raise ValueError('the value of input must not be negative'			)
		snake_case__	     =0
		while number:
				if number % 2 == 1:
						result += 1
				number >>= 1
		return result






def 				a  (     )       ->	None:

		def do_benchmark(UpperCamelCase_    :    int			) -> None:
				snake_case__	     ='import __main__ as z'
				print(f"""Benchmark when {number = }:"""			)
				print(f"""{get_set_bits_count_using_modulo_operator(UpperCamelCase_			) = }"""			)
				snake_case__	     =timeit('z.get_set_bits_count_using_modulo_operator(25)'      ,					setup=UpperCamelCase_			)
				print(f"""timeit() runs in {timing} seconds"""			)
				print(f"""{get_set_bits_count_using_brian_kernighans_algorithm(UpperCamelCase_			) = }"""			)
				snake_case__	     =timeit(
				    'z.get_set_bits_count_using_brian_kernighans_algorithm(25)'      ,					setup=UpperCamelCase_      ,					)
				print(f"""timeit() runs in {timing} seconds"""			)

		for number in (25, 37, 58, 0):
				do_benchmark(UpperCamelCase_			)
				print()


if __name__ == "__main__":
			import doctest

			doctest.testmod()
			benchmark()




