python (3.11.7)
    e9P                        d dl Z d dlZd dlZd dlZd dlZ eedd          dk    r ej        d           ej        dej	        ej
        z            j        Zdd
Z
dZ G d d
ej                  Zedk    r ej                     dS dS )    Nfloat_repr_style shortzHcorrectly-rounded string->float conversions not available on this systemam      # A numeric string consists of:
    (?P<sign>[-+])?          # an optional sign, followed by
    (?=\d|\.\d)              # a number with at least one digit
    (?P<int>\d*)             # having a (possibly empty) integer part
    (?:\.(?P<frac>\d*))?     # followed by an optional fractional part
    (?:E(?P<exp>[-+]?\d+))?  # and an optional exponent
    \Z
5      c           	         t          |           }|t          d          |                    d          pd}t          |                    d          |z             }t          |                    d          pd          t	          |          z
  }|                    d          d	k    }|d
t          |d          z  z  d
t          d|           z  }
}	|	s|rdnd
S |	                                |
                                z
  }||dk    r|	|z	  n|	| z  |
k    z
  }t          ||          |z
  }|	t          | d          z  |
t          |d          z  }
}	t          |	|
          \  }
}d|z  |
k    sd|z  |
k    r/|
dz  r*|
dz
  }
|
                                |dz   k    r
|
dz  }
|dz
  }|
                                |k    r	|||z
  k    sJ |
                                |k    s|||z
  k    sJ ||
                                z   |k    r|rdndS |
s|rdnd
S d|dz
  dz  z   }d|dz
  dz  z
  }|
|z  ||z
  }}
d                    |rd	nd|
d|z  z  |
d|z  z  ||d|z  z             S )zConvert a finite decimal string to a hex string representing an
    IEEE 754 binary64 float.  Return 'inf' or '-inf' on overflow.
    This function makes no use of floating-point arithmetic at any
    stage.Nzinvalid numeric stringfracr   intexp0sign-
   r   z	-0x0.0p+0z0x0.0p+0      -infinf      z{}0x{:x}.{:0{}x}p{:+d}   )	
strtod_parser
ValueErrorgroupr   lenmax
bit_lengthdivmodformat)smant_digmin_expmax_expmfractionintpartr   negativeabdeqrhexdigsshifts                    D/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/test/test_strtod.pystrtodr1      s    	aAy1222wwv$"H!''%..8+,,G
aggenn#
$
$s8}}
4Cwwv#%H2s3{{?"BAt$4qA 
 7&6{{J6 	
'AAFF!q&&aRA	--AAw("A 
QB
?AQNqA!Q<<DAqsQww!A#((q1u(	Q<<>>XaZ''
!GA
FA 
<<>>X%%!w/A*A*A*A*A<<>>X%%g.@)@)@)@)@ 	1<<>>G##!,vvu, 7&6{{J6 8A:/!G
!QE:q5yqA#**R	R[	BK	AgI
      r   c                       e Zd Zd Zd Zd Zd Zd Zd Zd Z	e
j                            e
j        j
        dz   d	d
          d             Zd
 Zd ZdS )StrtodTestsc           	          	 t          |          }|                                }n-# t          $ r |d         dk    rdnd}Y nt          $ r d}Y nw xY wt	          |          }|                     ||d                    |||                     dS )zCompare the result of Python's builtin correctly rounded
        string->float conversion (using float) to a pure Python
        correctly rounded string->float implementation.  Fail if the
        two methods give different results.r   r   r   r   zmemory errorzEIncorrectly rounded str->float conversion for {}: expected {}, got {}N)floathex
OverflowErrorMemoryErrorr1   assertEqualr   )selfr    fsgotexpecteds        r0   check_strtodzStrtodTests.check_strtodW   s    	qB &&((CC  	3 	3 	3aDCKK&&UCCC 	! 	! 	! CCC	! !993//5va3/G/G	I 	I 	I 	I 	Is   &