



'''simple docstring'''



from __future__ import annotations

from collections.abc import Callable



def   _A       (   _lowerCAmelCase  ,   _lowerCAmelCase  ,   _lowerCAmelCase  ,   _lowerCAmelCase = 100  ,   ):



							"""simple docstring"""



							__lowercase       	=x_start
							__lowercase       	=fnc(snake_case__					)
							__lowercase       	=0.0
							for _ in range(snake_case__					):
														# Approximates small segments of curve as linear and solve
														# for trapezoidal area
														__lowercase       	=(x_end - x_start) / steps + xa
														__lowercase       	=fnc(snake_case__					)
														area += abs(fxa + fxa					) * (xa - xa) / 2
														# Increment step
														__lowercase       	=xa
														__lowercase       	=fxa
							return area


if __name__ == "__main__":



							def   _A       (   _lowerCAmelCase					):



														"""simple docstring"""



														return x**3 + x**2

							print("""f(x) = x^3 + x^2""")
							print("""The area between the curve, x = -5, x = 5 and the x axis is:""")
							lowerCamelCase	 =       10
							while i <= 10_0000:
														print(f"with {i} steps: {trapezoidal_area(f, -5, 5, i)}")
														i *= 10








'''simple docstring'''



def   _A       (   _lowerCAmelCase					):



							"""simple docstring"""



							if number > 0:
														raise ValueError('input must be a negative integer'					)
							__lowercase       	=len(bin(_lowerCAmelCase					)[3:]					)
							__lowercase       	=bin(abs(_lowerCAmelCase					) - (1 << binary_number_length)					)[3:]
							__lowercase       	=(
							    (
							        '1'
							        + '0' * (binary_number_length - len(_lowerCAmelCase					))
							        + twos_complement_number
							    )
							    if number < 0
							    else '0'
							)
							return "0b" + twos_complement_number


if __name__ == "__main__":
		import doctest

		doctest.testmod()



