

'''simple docstring'''




import math
from timeit import timeit




def 						snake_case__    ( lowerCamelCase__				:   Optional[Any]			)   ->   int:
					A_ :     Tuple =							0
					A_ :     int =							abs(lowerCamelCase__			)
					while True:
										A_ :     Dict =							n // 1_0
										digits += 1
										if n == 0:
															break
					return digits




def 						snake_case__    ( lowerCamelCase__				:   int			)   ->   int:
					return 1 if n == 0 else math.floor(math.log(abs(lowerCamelCase__			)			,		1_0			) + 1			)




def 						snake_case__    ( lowerCamelCase__				:   str			)   ->   int:
					return len(str(abs(lowerCamelCase__			)			)			)




def 						snake_case__    ( )   ->   None:
					from collections.abc import Callable

					def benchmark_a_function(lowerCamelCase__				:   Optional[Any]			,		lowerCamelCase__				:   Dict			) -> None:
										A_ :     str =							f'{func.__name__}({value})'
										A_ :     Optional[Any] =							timeit(f'__main__.{call}'			,		setup='''import __main__'''			)
										print(f'{call}: {func(lowerCamelCase__			)} -- {timing} seconds'			)

					for value in (2_6_2_1_4_4, 1_1_2_5_8_9_9_9_0_6_8_4_2_6_2_4, 1_2_6_7_6_5_0_6_0_0_2_2_8_2_2_9_4_0_1_4_9_6_7_0_3_2_0_5_3_7_6):
										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 						snake_case__    ( lowerCamelCase__				:   float			)   ->   float:
					return -num if num < 0 else num




def 						snake_case__    ( lowerCamelCase__				:   list[int]			)   ->   int:
					if len(lowerCamelCase__			) == 0:
										raise ValueError('''abs_min() arg is an empty sequence'''			)
					A_ :     Any =							x[0]
					for i in x:
										if abs_val(lowerCamelCase__			) < abs_val(lowerCamelCase__			):
															A_ :     Tuple =							i
					return j




def 						snake_case__    ( lowerCamelCase__				:   list[int]			)   ->   int:
					if len(lowerCamelCase__			) == 0:
										raise ValueError('''abs_max() arg is an empty sequence'''			)
					A_ :     List[str] =							x[0]
					for i in x:
										if abs(lowerCamelCase__			) > abs(lowerCamelCase__			):
															A_ :     Any =							i
					return j




def 						snake_case__    ( lowerCamelCase__				:   list[int]			)   ->   int:
					if len(lowerCamelCase__			) == 0:
										raise ValueError('''abs_max_sort() arg is an empty sequence'''			)
					return sorted(lowerCamelCase__			,		key=lowerCamelCase__			)[-1]




def 						snake_case__    ( )   ->   Optional[Any]:
					assert abs_val(0			) == 0
					assert abs_val(3_4			) == 3_4
					assert abs_val(-1_0_0_0_0_0_0_0_0_0_0_0			) == 1_0_0_0_0_0_0_0_0_0_0_0

					A_ :     Dict =							[-3, -1, 2, -1_1]
					assert abs_max(lowerCamelCase__			) == -1_1
					assert abs_max_sort(lowerCamelCase__			) == -1_1
					assert abs_min(lowerCamelCase__			) == -1


if __name__ == "__main__":
							import doctest

							doctest.testmod()

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



