Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.128.171.99
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_strtod.pyc
�
@��cc@s�ddlZddlZddlZddlZddlZddlmZeedd�dkrvejd��nej	dej
ejB�jZ
dd	d
d�ZdZd
ejfd��YZd�Zedkr�e�ndS(i����N(ttest_supporttfloat_repr_stylettshortsHcorrectly-rounded string->float conversions not available on this systemsm    # 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
i5i���icCs�t|�}|dkr'td��n|jd�p9d}t|jd�|�}t|jd�pjd�t|�}|jd�dk}|d	t|d
�d	td
|�}	}
|	s�|r�dSdS|	j�|
j�}||d
kr�|	|?n|	|>|
k7}t||�|}|	t|d
�>|
t|d
�>}	}
t|	|
�\}
}d
||
ks�d
||
kr�|
d@r�|
d7}
|
j�|dkr�|
d
}
|d7}q�n|
j�|kr�|||ks�t	�|
j�|ks|||kst	�||
j�|kr8|r4dSdS|
sL|rHdSdSd|d
d}d|d
d}|
|>||}
}dj
|r�dnd|
d||
d|||d|�S(s�Convert 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.sinvalid numeric stringtfracRtinttexpt0tsignt-i
is	-0x0.0p+0s0x0.0p+0iis-inftinfiis{}0x{:x}.{:0{}x}p{:+d}iN(t
strtod_parsertNonet
ValueErrortgroupRtlentmaxt
bit_lengthtdivmodtAssertionErrortformat(tstmant_digtmin_exptmax_exptmtfractiontintpartRtnegativetatbtdtetqtrthexdigstshift((s7/usr/local/python-2.7/lib/python2.7/test/test_strtod.pytstrtodsF%,+(*

((i
tStrtodTestscBs�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Ze	j
de	jdd	d
e�d��Z
d�Zd
�ZRS(cCs�yt|�}WnCtk
r?|ddkr6dnd}n#tk
rUd}n
X|j�}t|�}|j||dj|||��dS(s�Compare 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.iR	s-infR
smemory errorsEIncorrectly rounded str->float conversion for {}: expected {}, got {}N(tfloatt
OverflowErrortMemoryErrorthexR%tassertEqualR(tselfRtfstgottexpected((s7/usr/local/python-2.7/lib/python2.7/test/test_strtod.pytcheck_strtodXs


c
Cs�x�dD]�}dd|}dd|}|ddkrH|d	7}nx\tt�D]N}tj||d�|}}x)|ddkr�|d|d	}}qzW|ddks�t�||}}x`|dkr(d
j||�}	|j|	�d
j|d|d�}	|j|	�|d9}q�W||}}xj|dkr�d
j||�}	|j|	�d
j|d|d�}	|j|	�|d9}|d	8}q9WqUWqWdS(Niii
iiii6i5iiii	s{}e{}i((iii
iiI@I��I I�(iiii	l F�x:^Vl	�O�z��p�cl F�x:^Vl	�O�z��p�c(txranget	TEST_SIZEtrandomt	randrangeRRR0(
R,tktuppertlowertitnR tdigitstexponentR((s7/usr/local/python-2.7/lib/python2.7/test/test_strtod.pyttest_short_halfway_casesks2








cCs�x�tdt�D]�}tjdd
�}t|d�\}}|r]|d|d}}n|d8}d|d|d}}|dkr�||>}d}n|d|}|}d	j||�}|j|�qWdS(
Nidi�ii4ii2iis{}e{}III(R1R2R3R4RRR0(R,R8tbitsR RR:R;R((s7/usr/local/python-2.7/lib/python2.7/test/test_strtod.pyttest_halfway_cases�s

	c	Cs�ddddg}x�|D]�\}}}xutd�D]g}|tjd|d
|�}|}dj||�}|j|�|d9}|d9}|d8}q5WqWdS(Nl�9Vi��iVl%o�$C�Ki!i�l�jT&i����iMii�i����is{}e{}i
i(l�9Vi��iV(l%o�$C�Ki!i�(l�jT&i����iM(ii����iM(R1R3R4RR0(	R,t
boundariesR9R tutjR:R;R((s7/usr/local/python-2.7/lib/python2.7/test/test_strtod.pyttest_boundaries�s	


cCsyxrtdd�D]a}d|d	}xItt�D];}|tjdd�}dj||�}|j|�q2WqWdS(
Nip���i����i
ii3i���i�s{}e{}lH(R1R2R3R4RR0(R,R;tbaseRAR:R((s7/usr/local/python-2.7/lib/python2.7/test/test_strtod.pyttest_underflow_boundary�scCszxsdD]k}d|}xXtdt�D]F}tj|�}tjd
d�}dj||�}|j|�q(WqWdS(Nii
iiiiiiii(i)i2ip���i�s{}e{}(ii
iiiiiiii(i)i2(R1R2R3R4RR0(R,tndigstdig10R8R:R;R((s7/usr/local/python-2.7/lib/python2.7/test/test_strtod.pyttest_bigcomp�s

cs�d�d}x�td�D]�}x�tt�D]z}tj|�}tjd�}|dj�fd�t|�D��7}tjttg�r�|d7}tjd�}|dj�fd	�t|�D��7}nd
}tjttg�rX|tjddg�7}|tj|�7}tjd
d�}|dj�fd�t|�D��7}n||rr|j|�q,yt	|�Wnt
k
r�q,Xts,td��q,WqWdS(Nt000000123456789t+R	Ri�ic3s|]}tj��VqdS(N(R3tchoice(t.0t_(R:(s7/usr/local/python-2.7/lib/python2.7/test/test_strtod.pys	<genexpr>�st.c3s|]}tj��VqdS(N(R3RJ(RKRL(R:(s7/usr/local/python-2.7/lib/python2.7/test/test_strtod.pys	<genexpr>�siR tEiic3s|]}tj��VqdS(N(R3RJ(RKRL(R:(s7/usr/local/python-2.7/lib/python2.7/test/test_strtod.pys	<genexpr>�ssexpected ValueError(RIR	R(R1R2R3RJR4tjointTruetFalseR0R'R
R(R,tsignsR8RARtintpart_lentfracpart_lentexponent_len((R:s7/usr/local/python-2.7/lib/python2.7/test/test_strtod.pyttest_parsing�s4)


tsizetmemuseitdry_runcCsvddtd�}|jt��t|�WdQX~ddtd�d}|jt��t|�WdQX~dS(Ns1.t1g�*d�As0.R(RtassertRaisesR
R'(R,tmaxsizeR((s7/usr/local/python-2.7/lib/python2.7/test/test_strtod.pyttest_oversized_digit_strings�scCs�d�}d�}|jt|d��d�|jt|d��d�|jt|d��d�|jt|d��d�|jt|d��d�|jt|d��d�dS(NcSsdjd|d|�S(s* Long string with value 1.0 and exponent ns	0.{}1e+{}Ri(R(R9((s7/usr/local/python-2.7/lib/python2.7/test/test_strtod.pytpositive_exp
scSsdjd||�S(s+ Long string with value 1.0 and exponent -ns1{}e-{}R(R(R9((s7/usr/local/python-2.7/lib/python2.7/test/test_strtod.pytnegative_expsi'g�?i Ni0u(R+R'(R,R^R_((s7/usr/local/python-2.7/lib/python2.7/test/test_strtod.pyttest_large_exponents
s		c+Cs�ddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+g+}x|D]}|j|�q�WdS(,Ns02183167012312112312312.23538020374420446192e-370s712579816049008305546974391768996369464963024663104e-357s717489628565202117263145367596028389348922981857013e-357s718487398785991994634182916638542680759613590482273e-357s732002864200581033134358724675198044527469366773928e-358s794393431193180696942841837085033647913224148539854e-358s773608278998966969345824653500136787876436005957953e-358s764774478836417299491718435234611299336288082136054e-358s713704940134126574534878641876947980878824688451169e-357s746697445774047060960624497964425416610480524760471e-358s728639097178261763178489759107321392745108491825303e-311s1.00000000000000001e44s-1.0000000000000000100000000000000000000001e44s399999999999999994487665465554760717039532578546e-47to9654371763336549317990355136719971183455700459144696213413350821416312194420007991306908470147322020121018368e0s104308485241983990666713401708072175773165034278685682646111762292409330928739751702404658197872319129036519947435319418387839758990478549477777586673075945844895981012024387992135617064532141489278815239849108105951619997829153633535314849999674266169258928940692239684771590065027025835804863585454872499320500023126142553932654370362024104462255244034053203998964360882487378334860197725139151265590832887433736189468858614521708567646743455601905935595381852723723645799866672558576993978025033590728687206296379801363024094048327273913079612469982585674824156000783167963081616214710691759864332339239688734656548790656486646106983450809073750535624894296242072010195710276073042036425579852459556183541199012652571123898996574563824424330960027873516082763671875e-1075s247032822920623295e-341s799037485700245683102805043437346965248029601286431e-373s799617639833743863161109961162881027406769510558457e-373s798852915025769345295749278351563179840130565591462e-372s799059944827693569659153042769690930905148015876788e-373s798914979205069368270421829889078356254059760327101e-372s,1000000000000000000000000000000000000000e-16s-10000000000000000000000000000000000000000e-17s=991633793189150720000000000000000000000000000000000000000e-33s;4106250198039490000000000000000000000000000000000000000e-38s*10.900000000000000012345678912345678912345s11651287494059419563861790709256988151903479322938522856916519154189084656466977171489691608488398792047332126810029685763620092606534076968286334920536334924763766067178320990794927368304039797998410780646182269333271282839761794603623958163297658510063352026077076106072540390412314438457161207373275477458821194440646557259102208197382844892733860255628785183174541939743301249188486945446244053689504749943655197464973191717009938776287102040358299419343976193341216682148401588363162253931420379903449798213003874174172790742957567330246138038659650118748200625752770984217933648838167281879845022933912352785884444833681591202045229462491699354638895656152216187535257259042082360747878839946016222830869374205287663441403533948204085390898399055004119873046875e-1075s^5254406533529552661096610603582028195612589849649138922565278497589560452182570597137658742514361936194432482059988700016338656575174473559922258529459120166686600002102838072098506622244175047522649953606315120077538558010753730576321577387528008403025962370502479105305382500086822727836607781816280407336531214924364088126680234780012085291903592543223403975751852488447885154107229587846409265285440430901153525136408849880173424692750069991045196209464308187671479664954854065777039726878381767789934729895619590000470366389383963331466851379030183764964083197053338684769252973171365139701890736933147103189912528110505014483268752328506004517760913030437151571912928276140468769502257147431182910347804663250851413437345649151934269945872064326973371182115272789687312946393533547747886024677951678751174816604738791256853675690543663283782215866825e-1180t32602129298404963083833853479113577253105939995688e2t5260212929840496308383385347911357725310593999568896e0s826021292984049630838338534791135772531059399956889601e-2t5260212929840496308383385347911357725310593999568895e0t5260212929840496308383385347911357725310593999568897e0t5260212929840496308383385347911357725310593999568996e0t5260212929840496308383385347911357725310593999568866e0s9007199254740992.00t5179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497792s9179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497791.999s9179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497792.001s:999999999999999944488848768742172978818416595458984375e-54sA9999999999999999444888487687421729788184165954589843749999999e-54sA9999999999999999444888487687421729788184165954589843750000001e-54(R0(R,ttest_stringsR((s7/usr/local/python-2.7/lib/python2.7/test/test_strtod.pyttest_particularsZ	
(t__name__t
__module__R0R<R>RBRDRGRVRtprecisionbigmemtestt_2GRQR]R`Rj(((s7/usr/local/python-2.7/lib/python2.7/test/test_strtod.pyR&Ws		+						$
	cCstjt�dS(N(Rtrun_unittestR&(((s7/usr/local/python-2.7/lib/python2.7/test/test_strtod.pyt	test_main�st__main__(R3tstructtunittesttretsysttestRtgetattrtSkipTesttcompiletVERBOSEt
IGNORECASEtmatchRR%R2tTestCaseR&RpRk(((s7/usr/local/python-2.7/lib/python2.7/test/test_strtod.pyt<module>s 9�U	
© 2025 GrazzMean