KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /usr/lib64/python2.4/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.4/test/test_long.pyc
mò
‚=5Dc@s÷dklZlZlZlZdklZdklZlZdZ	de	Z
e
dZdZdZ
eeddde
e
d?gƒZeidƒeid	ƒd
Zx3ede	ƒD]!Zeiedƒed>Zq¸W[eed„eƒed„eƒZd
„Zd„Zd„Zd„Ze
d„Zd„Zd„Zd„Zd„Ze
d„Zd„Zd„Z e
d„Z!e
d„Z"d„Z#d„Z$d„Z%d„Z&eƒeƒeƒe!ƒe"ƒe#ƒe$ƒe%ƒe&ƒdS( (sverifysverboses
TestFailedsfcmp(sjoin(srandomsrandintiiiiFilUUª*UUª*lª*UUª*UU
lcCs|S(N(tx(R((t&/usr/lib64/python2.4/test/test_long.pyt<lambda>scCs|S(N(R(R((RRscGs*|ptttt|ƒdƒ‚ndS(Nt (tokt
TestFailedtjointmaptstrtargs(RR	((Rtcheck"scCs2t|djƒ|t}|td}d}d}ttƒtdƒdB}x ||jo’|d?d}t|||ƒ}td|jo
tjnƒ||}||>}|d@o|d|>dB}nttƒtdƒ}qRWt||jo
|jnƒtƒdjo|}n|S(Niilif0.5(tverifytndigitstSHIFTtnbits_hitnbits_lotanswertnbitstinttrandomtrtbitstmin(RRRRRRR((Rtgetran,s(

!

!cCsSd}x+t|ƒD]}|t>tdtƒB}qWtƒdjo|}n|S(Nlif0.5(RtrangeRtiR
trandinttMASKR(RRR((Rtgetran2Ds
cCst||ƒ\}}||||}}||||}}t	||jd||ƒt	||jd||ƒt	||jd||ƒt	||||jd||ƒ|djo.t	d|jo
|jnd||ƒn+t	||jo
djnd||ƒdS(Ns#multiplication does not commute fors,divmod returns different quotient than / fors'divmod returns different mod than % forsx != q*y + r after divmod onisbad mod from divmod on(
tdivmodRtytqRtq2tr2tpabtpbaR
(RRR R!RR"RR#((Rttest_division_2Ns!
.cCs—to	dGHntd|dƒtttdƒ}|itdƒxK|D]C}t|ƒ}x.|D]&}t|ƒpd}t||ƒqeWqLWdS(Nslong / * % divmodiiil(tverboseRt	maxdigitstKARATSUBA_CUTOFFtdigitstappendtlenxRRtlenyRR$(R&R(RRR+R*((Rt
test_division[s	c

Csto	dGHntddƒtttdƒ}|itdtdgƒg}|D]}||tqV~}	x|	D]•}d|>d}x~|	D]v}||joq’nd|>d}||}d||>d|>d|>d}t||jd|d|||ƒq’WqwWdS(	Nt	Karatsubaiii
idlsbad result fort*(R%RR'R(textendt_[1]tdigitR
RtabitstatbbitstbRRR
(
R(R3R1R5R4R2R0RRR((Rttest_karatsubahs 	 %

"cCs[t|d@djd|ƒt|dB|jd|ƒt|dA|jd|ƒt|d@|jd|ƒt|dBdjd|ƒt|dA|jd|ƒt||jd	|ƒt||@|jd
|ƒt||B|jd|ƒt||Adjd|ƒt||@djd
|ƒt||Bdjd|ƒt||Adjd|ƒt|d|jo|djnd|ƒxÎtdtƒD]¼}d|}t||>|?|jd||ƒt||||?jd|||ƒt||||>jd|||ƒt||@||?|>jo||d@jnd|||ƒq—WdS(Nisx & 0 != 0 forsx | 0 != x forsx ^ 0 != x foriÿÿÿÿsx & -1 != x forsx | -1 != -1 forsx ^ -1 != ~x forsx != ~~x forsx & x != x forsx | x != x forsx ^ x != 0 forsx & ~x != 0 forsx | ~x != -1 forsx ^ ~x != -1 forisnot -x == 1 + ~x == ~(x-1) forilsx << n >> n != x forsx // p2 != x >> n for x n p2sx * p2 != x << n for x n p2s6not x & -p2 == x >> n << n == x & ~(p2 - 1) for x n p2(R
RRR
tntp2(RR8R7((Rttest_bitop_identities_1‚s.2
!$$3cCsPt||@||@jd||ƒt||B||Bjd||ƒt||A||Ajd||ƒt||A|A|jd||ƒt||@||Bjd||ƒt||B||@jd||ƒt||A||B||@@jd||ƒt||A||@||@Bjd||ƒt||A||B||B@jd	||ƒdS(
Nsx & y != y & x forsx | y != y | x forsx ^ y != y ^ x forsx ^ y ^ x != y forsx & y != ~(~x | ~y) forsx | y != ~(~x & ~y) forsx ^ y != (x | y) & ~(x & y) fors x ^ y == (x & ~y) | (~x & y) fors x ^ y == (x | y) & (~x | ~y) for(R
RR(RR((Rttest_bitop_identities_2šs!!!!$$

cCsèt||@|@|||@@jd|||ƒt||B|B|||BBjd|||ƒt||A|A|||AAjd|||ƒt|||B@||@||@Bjd|||ƒt|||@B||B||B@jd|||ƒdS(Ns(x & y) & z != x & (y & z) fors(x | y) | z != x | (y | z) fors(x ^ y) ^ z != x ^ (y ^ z) fors$x & (y | z) != (x & y) | (x & z) fors$x | (y & z) != (x | y) & (x | z) for(R
RRtz(RRR;((Rttest_bitop_identities_3¨s  cCs±to	dGHnxtD]}t|ƒqWtd|dƒ}xl|D]d}t|ƒ}t|ƒxE|D]=}t|ƒ}t||ƒt||t||dƒƒqhWqEWdS(Nslong bit-operation identitiesii(
R%tspecialRR9RR&R(R*RR+RR:R<(R&R(RRR+R*((Rttest_bitop_identities´s	

cCsß||fd
jodSng}d}|djod|}}nx4|o,t||ƒ\}}|it|ƒƒqIW|iƒ|pdg}d| hdd<dd<d	d
<|t	t
d„|ƒdƒdS(Niit0Lit-t0i
tit0xcCsd|S(Nt0123456789ABCDEF(R(R((RRÓstL(ii(RtbaseR(tsignRRR)RtreverseRR(RRFR(RGR((Rtslow_formatÄs

c
Csðdkl}x•dtfdtfdtffD]r\}}||ƒ}t	||ƒ}t||j|id|d|d|ƒt||dƒ|jd	||ƒq/Wt
|ƒ}t	|dƒd
 }t||j|id|d|d|ƒdS(N(satolii
itreturnedsbut expectedtforisatol("%s", 0) !=iÿÿÿÿ(tstringtatoltocttreprthexRFtmapperRtgotRItexpectedR
t__name__R(RRQRFRMRRRS((Rt
test_format_1Ös
"'cCszto	dGHnxtD]}t|ƒqWxHtdƒD]:}x1td|dƒD]}t|ƒ}t|ƒqRWq8WdS(Nslong str/hex/oct/atoli
i(	R%R=RRURRR&R*R(R&RRR*((Rttest_formatås	
c	Csîto	dGHndk}|i}|d}t|ƒ}t|ƒ}t||jdƒt||jdƒytt	|ƒ|jdƒWnt
j
otd‚nXytt	|ƒ|jdƒWnt
j
otd‚nX|d}yt	|ƒ}Wnt
j
otd	‚nXt|tƒptd
ƒ‚n|d}yt	|ƒ}Wnt
j
otd‚nXt|tƒptdƒ‚nd
tfd„ƒY}|dd>ƒ}t	|ƒ}t|ƒtj	otdƒ‚ndS(Nslong miscellaneous operationsislong(sys.maxint) != sys.maxints$long(-sys.maxint-1) != -sys.maxint-1s3converting sys.maxint to long and back to int failss!int(long(sys.maxint)) overflowed!s6converting -sys.maxint-1 to long and back to int failss$int(long(-sys.maxint-1)) overflowed!s*int(long(sys.maxint) + 1) mustn't overflows3int(long(sys.maxint) + 1) should have returned longs-int(long(-sys.maxint-1) - 1) mustn't overflows6int(long(-sys.maxint-1) - 1) should have returned longtlong2cBstZRS(N(RTt
__module__(((RRWslids<overflowing int conversion must return long not long subtype(R%tsystmaxintthugeposthugenegtlongthugepos_aslongthugeneg_aslongR
Rt
OverflowErrorRRRt
isinstanceRWttype(	R&R[R^RWRYR\R_RR((Rt	test_miscñsN			

csdk}dk}to	dGHndddd|id|i|idg}t|i|iƒƒ}|i|d||dgƒ|ig}
|D]}	|
|	q•~
ƒ‡‡d†}xZ|D]R}t|ƒ}|‰|‰|d|ƒx"|D]}t|ƒ}||‰||‰||d|ƒ||‰||‰||d|ƒ||‰||‰||d	|ƒ|oz||‰||‰||d
|ƒ||‰||‰||d|ƒt||ƒ‰t||ƒ‰||d|ƒnt|ƒd
jo|djo
|djoí||‰||‰||d|ƒxÆ|D]º}
|
djo§|djoDt||t|
ƒƒ‰t|||
ƒ‰|d||d|
ƒq	yt||t|
ƒƒWntj
oq	Xtd||t|
ƒffƒ‚qOqOWq÷q÷WqÃWdS(Ns"auto-convert int->long on overflowiiiics$tˆˆjd|ˆˆfƒdS(Nsfor %r expected %r got %r(RRRRSR	(R	(RSRR(Rtcheckit/sR@t+R.t/s//Ris**tpowt%s"pow%r should have raised TypeError(tmathRYR%RZR=RtsqrtR/R0RRdRR]tlongxRSRRRtlongyRtabsR;Rgt	TypeErrorR(RlRkR=RjRSRiRdRRRYRR0RRR;((RSRRRttest_auto_overflow$sh	,)










.



c&Csrdk}to	dGHnx*d7D]"}ttt|ƒƒ|jƒq Wdd}d	d
>}|}hd|<d|<d
|<d|<}xàdddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4g&D]f}yt||ƒWntj
onXt
d5|ƒ‚t|ƒt|ƒjot
d6ƒ‚qqWdS(8Nslong->float overflowf-2.0f-1.0f0.0f1.0f2.0t12345ixli0uthugetmhugetshugeRisfloat(huge)sfloat(mhuge)s
complex(huge)scomplex(mhuge)scomplex(huge, 1)scomplex(mhuge, 1)scomplex(1, huge)scomplex(1, mhuge)s	1. + huges	huge + 1.s
1. + mhuges
mhuge + 1.s	1. - huges	huge - 1.s
1. - mhuges
mhuge - 1.s	1. * huges	huge * 1.s
1. * mhuges
mhuge * 1.s
1. // huges
huge // 1.s1. // mhugesmhuge // 1.s	1. / huges	huge / 1.s
1. / mhuges
mhuge / 1.s
1. ** huges
huge ** 1.s1. ** mhugesmhuge ** 1.smath.sin(huge)smath.sin(mhuge)smath.sqrt(huge)smath.sqrt(mhuge)smath.floor(huge)smath.floor(mhuge)sexpected OverflowError from %ss(float(shuge) should not equal int(shuge)(f-2.0f-1.0f0.0f1.0f2.0(RiR%RRtfloatR]RsRqRrt	namespacettesttevalR`RR(RqRuRrRvRRiRs((Rttest_float_overflowms&		 

*ycCs<dk}to	dGHn|i|iƒ}x…tdƒdddgD]j}d|}|i|ƒ}tt	||ƒdjƒ||}|i|ƒ}tt	||ƒdjƒqEWx‚dd>dd	fD]l}y|i|ƒt
d
ƒ‚Wntj
onXy|i|ƒt
dƒ‚WqÈtj
oqÈXqÈWdS(Ns
log and log10i
idièi'illÿÿÿÿls"expected ValueError from log(<= 0)s$expected ValueError from log10(<= 0)(RiR%tlog10tetLOG10ERtexptvalueRtfcmpRStlogtbadRt
ValueError(R{R€R}R|RSRyRiR((Rt	test_logs–s0		



cs#dk‰dk}to	dGHndf‡‡d†ƒY‰dddddd	d
g}
xrdddd
ddfD]U}|
i|d|d||d|dt|dƒt|ƒt|dƒgƒqrW|
iddd|it	|iƒgƒtd
ƒ}|
iddddd>|d||dgƒ|
ig}|
D]}	||	q>~ƒxÆ|
D]¾}	ˆ|	ƒ}x©|
D]¡}ˆ|ƒ}t||ƒ}t|	|ƒ}||jo td|	|||fƒ‚n|	|j|djjotd|	||fƒ‚n|	|j|djjotd|	||fƒ‚n|	|j|djjotd|	||fƒ‚n|	|j|djjotd|	||fƒ‚n|	|j|djjotd|	||fƒ‚n|	|j|djjotd|	||fƒ‚qvqvWq]WdS(Nsmixed comparisonstRatcs tZ‡d†Z‡d†ZRS(Nc	s¹t|ttfƒo||_d|_nŠt|tƒoiˆi	t
|ƒƒ\}}|djp%d|jo
djnpt
‚d}d}x‰|oˆi||ƒ}t|ƒ}||?djpt
‚||>|B}||8}d|jo
djnpt
‚||8}q˜W|djo||>}d}n|}d|>}|djo|}n||_||_t|ƒt|ƒ|jpt
‚ntdtƒ‚dS(Niif0.5f1.0if0.0scan't deal with %r(RaR}RR]tselfR7tdRtRitfrexpRmtfRztAssertionErrortCHUNKttoptldexpR1Rntval(	R„R}R1RzR…R‡R7RŠR‰(Ri(Rt__init__Ås8	
2
%



		(csAt|ˆƒpˆ|ƒ}nt|i|i|i|iƒS(N(RatotherRƒtcmpR„R7R…(R„RŽ(Rƒ(Rt__cmp__ïs(RTRXRR((RƒRi(RRƒÄs*if0.001f0.98999999999999999f1.0f1.5f1e+20f9.9999999999999997e+199f2.0i0i2i5f0.29999999999999999iillli Ns%r %r %d %ds%r == %r %ds%r != %r %ds
%r < %r %ds%r <= %r %ds
%r > %r %ds%r >= %r %d(RiRYR%RƒtcasesttR/R]RZRtR0RtRxRtRyRtRcmptxycmpR(R0R•R“R”R–RYRƒR’RRR‘Ri((RƒRiRttest_mixed_compares¸sF			0S(.)
 N('ttest.test_supportRR%RR~RLRRRR
tBASERR't	MAXDIGITSRR]R=R)R8RRR
RRR$R,R6R9R:R<R>RIRURVRcRoRxR‚R—(!RVR%R:R
RR6R—R$RxR
R=R9RoRRR<RRR>RšR,RR™R'RRIR8RRR‚R~RcRU((Rt?sX


"

&	
		
	

						3	I	)	"	_

Anon7 - 2021