






"""simple docstring"""



def      _lowerCAmelCase		(							UpperCAmelCase__       :					int,						UpperCAmelCase__       :					int      )		->float:
						return base * power(UpperCAmelCase__,						(exponent - 1)      ) if exponent else 1


if __name__ == "__main__":
						print('''Raise base to the power of exponent using recursion...''')
						A_    =							int(input('''Enter the base: ''').strip())
						A_    =							int(input('''Enter the exponent: ''').strip())
						A_    =							power(base, abs(exponent))
						if exponent < 0:  # power() does not properly deal w/ negative exponents
												A_    =							1 / result
						print(F'{base} to the power of {exponent} is {result}')








"""simple docstring"""



from timeit import timeit




def      _lowerCAmelCase		(							UpperCAmelCase__       :					int      )		->int:
						if number < 0:
												raise ValueError("""the value of input must not be negative"""      )
						A__						:  Optional[int]		  =  0
						while number:
												number &= number - 1
												result += 1
						return result




def      _lowerCAmelCase		(							UpperCAmelCase__       :					int      )		->int:
						if number < 0:
												raise ValueError("""the value of input must not be negative"""      )
						A__						:  Tuple		  =  0
						while number:
												if number % 2 == 1:
																		result += 1
												number >>= 1
						return result




def      _lowerCAmelCase		(							)		->None:

						def do_benchmark(UpperCAmelCase__       :					int      ) -> None:
												A__						:  Optional[int]		  =  """import __main__ as z"""
												print(f'Benchmark when {number = }:'      )
												print(f'{get_set_bits_count_using_modulo_operator(UpperCAmelCase__      ) = }'      )
												A__						:  Any		  =  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__      ) = }'      )
												A__						:  List[str]		  =  timeit(
												    """z.get_set_bits_count_using_brian_kernighans_algorithm(25)""",						setup=UpperCAmelCase__,						)
												print(f'timeit() runs in {timing} seconds'      )

						for number in (2_5, 3_7, 5_8, 0):
												do_benchmark(UpperCAmelCase__      )
												print()


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						benchmark()






