



'''simple docstring'''



from math import pi, sqrt



def   _A       (   _lowerCAmelCase					):



							"""simple docstring"""



							if num <= 0:
														raise ValueError('math domain error'					)
							if num > 171.5:
														raise OverflowError('math range error'					)
							elif num - int(__snake_case					) not in (0, 0.5):
														raise NotImplementedError('num must be an integer or a half-integer'					)
							elif num == 0.5:
														return sqrt(__snake_case					)
							else:
														return 1.0 if num == 1 else (num - 1) * gamma(num - 1					)



def   _A       (   ):



							"""simple docstring"""



							assert gamma(0.5					) == sqrt(__snake_case					)
							assert gamma(1					) == 1.0
							assert gamma(2					) == 1.0


if __name__ == "__main__":
		from doctest import testmod

		testmod()
		lowerCamelCase	 =       1.0
		while num:
				lowerCamelCase	 =       float(input("""Gamma of: """))
				print(f"gamma({num}) = {gamma(num)}")
				print("""\nEnter 0 to exit...""")








'''simple docstring'''



def   _A       (   _lowerCAmelCase					):



							"""simple docstring"""



							if not isinstance(_lowerCAmelCase  ,   _lowerCAmelCase					):
														raise TypeError('only integers accepted as input'					)
							else:
														__lowercase       	=str(abs(_lowerCAmelCase					)					)
														__lowercase       	=[list(_lowerCAmelCase					) for char in range(len(_lowerCAmelCase					)					)]
														for index in range(len(_lowerCAmelCase					)					):
																					num_transpositions[index].pop(_lowerCAmelCase					)
														return max(
														    int(''.join(list(_lowerCAmelCase					)					)					) for transposition in num_transpositions					)


if __name__ == "__main__":
		__import__("""doctest""").testmod()



