


'''simple docstring'''
import unittest
from timeit import timeit







def 			a_							(  UpperCamelCase_	,     UpperCamelCase_   ):
							A_ 						=		first_num if first_num >= second_num else second_num
							A_ 						=		max_num
							while (common_mult % first_num > 0) or (common_mult % second_num > 0):
														common_mult += max_num
							return common_mult







def 			a_							(  UpperCamelCase_	,     UpperCamelCase_   ):
							return b if a == 0 else greatest_common_divisor(b % a	,     _UpperCamelCase   )







def 			a_							(  UpperCamelCase_	,     UpperCamelCase_   ):
							return first_num // greatest_common_divisor(_UpperCamelCase	,     _UpperCamelCase   ) * second_num







def 			a_							(  ):
							A_ 						=		(
							    "from __main__ import least_common_multiple_slow, least_common_multiple_fast"
							)
							print(
							    "least_common_multiple_slow():"	,     timeit("least_common_multiple_slow(1000, 999)"	,     setup=_UpperCamelCase   )	,     )
							print(
							    "least_common_multiple_fast():"	,     timeit("least_common_multiple_fast(1000, 999)"	,     setup=_UpperCamelCase   )	,     )






class 				__lowerCAmelCase      (      unittest.TestCase	):

						"""simple docstring"""






						_UpperCAmelCase		:					str      	=	(
						    (10, 20),
						    (13, 15),
						    (4, 31),
						    (10, 42),
						    (43, 34),
						    (5, 12),
						    (12, 25),
						    (10, 25),
						    (6, 9),
						)
						_UpperCAmelCase		:					int      	=	(20, 195, 124, 210, 1462, 60, 300, 50, 18)






						def 							_UpperCAmelCase					(     self       :			List[Any]  ):



													for i, (first_num, second_num) in enumerate(self.test_inputs  ):
																				A_ 						=		least_common_multiple_slow(a_   ,     a_  )
																				A_ 						=		least_common_multiple_fast(a_   ,     a_  )
																				with self.subTest(i=a_  ):
																											self.assertEqual(a_   ,     self.expected_results[i]  )
																											self.assertEqual(a_   ,     self.expected_results[i]  )


if __name__ == "__main__":
							benchmark()
							unittest.main()









'''simple docstring'''
def 			a_							(  UpperCamelCase_	,     UpperCamelCase_ = 1_0_0_0   ):
							if (not isinstance(UpperCamelCase_	,     UpperCamelCase_   )) or (digit_position <= 0):
														raise ValueError("Digit position must be a positive integer"   )
							elif (not isinstance(UpperCamelCase_	,     UpperCamelCase_   )) or (precision < 0):
														raise ValueError("Precision must be a nonnegative integer"   )

							# compute an approximation of (16 ** (n - 1)) * pi whose fractional part is mostly
							# accurate
							A_ 						=		(
							    4 * _subsum(UpperCamelCase_	,     1	,     UpperCamelCase_   )
							    - 2 * _subsum(UpperCamelCase_	,     4	,     UpperCamelCase_   )
							    - _subsum(UpperCamelCase_	,     5	,     UpperCamelCase_   )
							    - _subsum(UpperCamelCase_	,     6	,     UpperCamelCase_   )
							)

							# return the first hex digit of the fractional part of the result
							return hex(int((sum_result % 1) * 1_6   )   )[2:]







def 			a_							(  UpperCamelCase_	,     UpperCamelCase_	,     UpperCamelCase_   ):
							A_ 						=		0.0
							for sum_index in range(digit_pos_to_extract + precision   ):
														A_ 						=		8 * sum_index + denominator_addend
														if sum_index < digit_pos_to_extract:
																					# if the exponential term is an integer and we mod it by the denominator
																					# before dividing, only the integer part of the sum will change;
																					# the fractional part will not
																					A_ 						=		pow(
																					    1_6	,     digit_pos_to_extract - 1 - sum_index	,     UpperCamelCase_   )
														else:
																					A_ 						=		pow(1_6	,     digit_pos_to_extract - 1 - sum_index   )
														total += exponential_term / denominator
							return total


if __name__ == "__main__":
							import doctest

							doctest.testmod()





