code: def 					__lowerCAmelCase			(  _A ,_A = 1_000					):
  
  
  
  							"""simple docstring"""
  
  
  							if (not isinstance(_A ,_A					)) or (digit_position <= 0):
  														raise ValueError("""Digit position must be a positive integer"""					)
  							elif (not isinstance(_A ,_A					)) or (precision < 0):
  														raise ValueError("""Precision must be a nonnegative integer"""					)
  
  							# compute an approximation of (16 ** (n - 1)) * pi whose fractional part is mostly
  							# accurate
  							_lowercase				=	(
  							    4 * _subsum(_A ,1 ,_A					)
  							    - 2 * _subsum(_A ,4 ,_A					)
  							    - _subsum(_A ,5 ,_A					)
  							    - _subsum(_A ,6 ,_A					)
  							)
  
  							# return the first hex digit of the fractional part of the result
  							return hex(int((sum_result % 1) * 16					)					)[2:]
  
  
  def 					__lowerCAmelCase			(  _A ,_A ,_A					):
  
  
  
  							"""simple docstring"""
  
  
  							_lowercase				=	0.0
  							for sum_index in range(digit_pos_to_extract + precision					):
  														_lowercase				=	8 * sum_index + denominator_addend
  														if sum_index < digit_pos_to_extract:
  																					# if the exponential term is an integer and we mod it by the denominator
  																					# before dividing, only the integer part of the sum will change;
  																					# the fractional part will not
  																					_lowercase				=	pow(
  																					    16 ,digit_pos_to_extract - 1 - sum_index ,_A					)
  														else:
  																					_lowercase				=	pow(16 ,digit_pos_to_extract - 1 - sum_index					)
  														total += exponential_term / denominator
  							return total
  
  
  if __name__ == "__main__":
  				import doctest
  
  				doctest.testmod()
  
  
  
style_context: def 					__lowerCAmelCase			(  _A = 998_001					):
  
  
  
  							"""simple docstring"""
  
  
  							_lowercase				=	0
  							for i in range(999 ,99 ,-1					):  # 3 digit numbers range from 999 down to 100
  														for j in range(999 ,99 ,-1					):
  																					_lowercase				=	str(i * j					)
  																					if product_string == product_string[::-1] and i * j < n:
  																												_lowercase				=	max(_A ,i * j					)
  							return answer
  
  
  if __name__ == "__main__":
  				print(F'''{solution() = }''')
  
  
  