
    !.du                     f    d Z ddlmZ dedefdZdedefdZdedefdZdedefdZd	edd
fdZd
S )z
Formatting numeric literals.
    )Leaftextreturnc                 Z    | dd         | dd         }}| |                                  S )z4
    Formats a hexadecimal string like "0x12B3"
    N   )upperr   beforeafters      .lib/python3.11/site-packages/black/numerics.py
format_hexr      s6     !Hd122hEF%ekkmm%%%    c                     |                      d          \  }}d}|                    d          r|dd         }d}n|                    d          r
|dd         }t          |          }| d| | S )z5Formats a numeric string utilizing scentific notatione -   N+)split
startswithformat_float_or_int_string)r   r
   r   signs       r   format_scientific_notationr      s    JJsOOMFED abb				#		 abb	'//F$$t$U$$$r   c                 L    | dd         }| d         }t          |           | S )z#Formats a complex string like `10j`N)r   )r   numbersuffixs      r   format_complex_numberr      s1    #2#YF"XF(00:&:::r   c                 T    d| vr| S |                      d          \  }}|pd d|pd S )z"Formats a float string like "1.0"..r   )r   r	   s      r   r   r   #   s?    
$JJsOOMFEk((EJQ(((r   leafNc                 L   | j                                         }|                    d          rnm|                    d          rt          |          }nHd|v rt	          |          }n4|                    d          rt          |          }nt          |          }|| _         dS )zNormalizes numeric (float, int, and complex) literals.

    All letters used in the representation are normalized to lowercase.)0o0b0xr   jN)valuelowerr   r   r   endswithr   r   )r!   r   s     r   normalize_numeric_literalr*   ,   s     :D|$$ 
0			 0$	)$//	s		 0$T**)$//DJJJr   )	__doc__blib2to3.pytreer   strr   r   r   r   r*    r   r   <module>r/      s     !          &S &S & & & &
%S 
%S 
% 
% 
% 
%; ; ; ; ; ;)S )S ) ) ) )D T      r   