





'''simple docstring'''

from math import pi, sqrt







def 							UpperCAmelCase_    (	lowerCAmelCase_							):

				"""simple docstring"""






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







def 							UpperCAmelCase_    (	):

				"""simple docstring"""






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


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

			testmod()
			__lowerCamelCase : Optional[Any]											=			1.0
			while num:
						__lowerCamelCase : int											=			float(input("Gamma of: "))
						print(f"gamma({num}) = {gamma(num)}")
						print("\nEnter 0 to exit...")











'''simple docstring'''

__lowerCamelCase : str											=			8.314_4598







def 							UpperCAmelCase_    (	lowerCAmelCase_		,							lowerCAmelCase_							):

				"""simple docstring"""






				if temperature < 0:
								raise Exception("Temperature cannot be less than 0 K"							)
				if molar_mass <= 0:
								raise Exception("Molar mass cannot be less than or equal to 0 kg/mol"							)
				else:
								return (3 * UNIVERSAL_GAS_CONSTANT * temperature / molar_mass) ** 0.5


if __name__ == "__main__":
			import doctest

			# run doctest
			doctest.testmod()

			# example
			__lowerCamelCase : Optional[Any]											=			300
			__lowerCamelCase : Tuple											=			28
			__lowerCamelCase : str											=			rms_speed_of_molecule(temperature, molar_mass)
			print(f"Vrms of Nitrogen gas at 300 K is {vrms} m/s")




