






"""simple docstring"""
import math
from timeit import timeit





def 							lowercase__		(				lowerCamelCase					):
				_SCREAMING_SNAKE_CASE      :		Tuple							=						0
				_SCREAMING_SNAKE_CASE      :		int							=						abs(lowerCamelCase					)
				while True:
								_SCREAMING_SNAKE_CASE      :		Dict							=						n // 10
								digits += 1
								if n == 0:
												break
				return digits





def 							lowercase__		(				lowerCamelCase					):
				return 1 if n == 0 else math.floor(math.log(abs(lowerCamelCase					),	10					) + 1					)





def 							lowercase__		(				lowerCamelCase					):
				return len(str(abs(lowerCamelCase					)					)					)





def 							lowercase__		(				):
				from collections.abc import Callable

				def benchmark_a_function(lowerCamelCase,	lowerCamelCase					) -> None:
								_SCREAMING_SNAKE_CASE      :		List[Any]							=						f"""{func.__name__}({value})"""
								_SCREAMING_SNAKE_CASE      :		Tuple							=						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()









"""simple docstring"""
def 							lowercase__		(				lowerCamelCase					):
				return -num if num < 0 else num





def 							lowercase__		(				lowerCamelCase					):
				if len(lowerCamelCase					) == 0:
								raise ValueError('abs_min() arg is an empty sequence'					)
				_SCREAMING_SNAKE_CASE      :		List[Any]							=						x[0]
				for i in x:
								if abs_val(lowerCamelCase					) < abs_val(lowerCamelCase					):
												_SCREAMING_SNAKE_CASE      :		List[Any]							=						i
				return j





def 							lowercase__		(				lowerCamelCase					):
				if len(lowerCamelCase					) == 0:
								raise ValueError('abs_max() arg is an empty sequence'					)
				_SCREAMING_SNAKE_CASE      :		Tuple							=						x[0]
				for i in x:
								if abs(lowerCamelCase					) > abs(lowerCamelCase					):
												_SCREAMING_SNAKE_CASE      :		Optional[Any]							=						i
				return j





def 							lowercase__		(				lowerCamelCase					):
				if len(lowerCamelCase					) == 0:
								raise ValueError('abs_max_sort() arg is an empty sequence'					)
				return sorted(lowerCamelCase,	key=lowerCamelCase					)[-1]





def 							lowercase__		(				):
				assert abs_val(0					) == 0
				assert abs_val(34					) == 34
				assert abs_val(-100_000_000_000					) == 100_000_000_000

				_SCREAMING_SNAKE_CASE      :		Tuple							=						[-3, -1, 2, -11]
				assert abs_max(lowerCamelCase					) == -11
				assert abs_max_sort(lowerCamelCase					) == -11
				assert abs_min(lowerCamelCase					) == -1


if __name__ == "__main__":
			import doctest

			doctest.testmod()

			test_abs_val()
			print(abs_val(-34))  # --> 34

