"""simple docstring"""







def   a__      (		UpperCAmelCase__       :			float			)->	float:
						return -num if num < 0 else num


def   a__      (		UpperCAmelCase__       :			list[int]			)->	int:
						if len(UpperCAmelCase__			) == 0:
												raise ValueError("""abs_min() arg is an empty sequence"""			)
						UpperCAmelCase__						=		x[0]
						for i in x:
												if abs_val(UpperCAmelCase__			) < abs_val(UpperCAmelCase__			):
																		UpperCAmelCase__						=		i
						return j


def   a__      (		UpperCAmelCase__       :			list[int]			)->	int:
						if len(UpperCAmelCase__			) == 0:
												raise ValueError("""abs_max() arg is an empty sequence"""			)
						UpperCAmelCase__						=		x[0]
						for i in x:
												if abs(UpperCAmelCase__			) > abs(UpperCAmelCase__			):
																		UpperCAmelCase__						=		i
						return j


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


def   a__      (		)->	str:
						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

						UpperCAmelCase__						=		[-3, -1, 2, -1_1]
						assert abs_max(UpperCAmelCase__			) == -1_1
						assert abs_max_sort(UpperCAmelCase__			) == -1_1
						assert abs_min(UpperCAmelCase__			) == -1


if __name__ == "__main__":
						import doctest

						doctest.testmod()

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


"""simple docstring"""







import math
from timeit import timeit


def   a__      (		UpperCAmelCase__       :			int			)->	int:
						UpperCAmelCase__						=		0
						UpperCAmelCase__						=		abs(UpperCAmelCase__			)
						while True:
												UpperCAmelCase__						=		n // 1_0
												digits += 1
												if n == 0:
																		break
						return digits


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


def   a__      (		UpperCAmelCase__       :			int			)->	int:
						return len(str(abs(UpperCAmelCase__			)			)			)


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

						def benchmark_a_function(UpperCAmelCase__       :			Callable		,			UpperCAmelCase__       :			int			) -> None:
												UpperCAmelCase__						=		f'{func.__name__}({value})'
												UpperCAmelCase__						=		timeit(f'__main__.{call}'		,			setup="""import __main__"""			)
												print(f'{call}: {func(UpperCAmelCase__			)} -- {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(UpperCAmelCase__		,			UpperCAmelCase__			)
												print()


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						benchmark()

