






import random





class __lowerCamelCase				:





	"""simple docstring"""






	def __init__(							self ,					UpperCAmelCase ,					UpperCAmelCase					):
							"""simple docstring"""







							_UpperCAmelCase             =    x
							_UpperCAmelCase             =    y

	def  UpperCamelCase					(							self					):
							"""simple docstring"""







							return (self.x**2 + self.y**2) <= 1

	@classmethod
	def  UpperCamelCase					(							cls					):
							"""simple docstring"""







							return cls(x=random.random() ,					y=random.random()					)



def __A					(   __lowerCAmelCase			)->						float:





						"""simple docstring"""



						if number_of_simulations < 1:
												raise ValueError('At least one simulation is necessary to estimate PI.'			)

						_UpperCAmelCase             =    0
						for _ in range(__lowerCAmelCase			):
												_UpperCAmelCase             =    Point.random_unit_square()

												if random_point.is_in_unit_circle():
																		number_in_unit_circle += 1

						return 4 * number_in_unit_circle / number_of_simulations


if __name__ == "__main__":
		# import doctest

		# doctest.testmod()
		from math import pi

		_a   			=						'''Please enter the desired number of Monte Carlo simulations: '''
		_a   			=						estimate_pi(int(input(prompt).strip()))
		print(F'''An estimate of PI is {my_pi} with an error of {abs(my_pi - pi)}''')








import math
from timeit import timeit


def __A					(   __lowerCAmelCase			)->						int:





						"""simple docstring"""



						_UpperCAmelCase             =    0
						_UpperCAmelCase             =    abs(__lowerCAmelCase			)
						while True:
												_UpperCAmelCase             =    n // 10
												digits += 1
												if n == 0:
																		break
						return digits


def __A					(   __lowerCAmelCase			)->						int:





						"""simple docstring"""



						return 1 if n == 0 else math.floor(math.log(abs(__lowerCAmelCase			)				,	10			) + 1			)


def __A					(   __lowerCAmelCase			)->						int:





						"""simple docstring"""



						return len(str(abs(__lowerCAmelCase			)			)			)


def __A					(   )->						None:





						"""simple docstring"""



						from collections.abc import Callable

						def benchmark_a_function(__lowerCAmelCase				,	__lowerCAmelCase			) -> None:
												_UpperCAmelCase             =    F"""{func.__name__}({value})"""
												_UpperCAmelCase             =    timeit(F"""__main__.{call}"""				,	setup='import __main__'			)
												print(F"""{call}: {func(__lowerCAmelCase			)} -- {timing} seconds"""			)

						for value in (262_144, 1_125_899_906_842_624, 1_267_650_600_228_229_401_496_703_205_376):
												for func in (num_digits, num_digits_fast, num_digits_faster):
																		benchmark_a_function(__lowerCAmelCase				,	__lowerCAmelCase			)
												print()


if __name__ == "__main__":
		import doctest

		doctest.testmod()
		benchmark()
