%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/test/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/test/test_cmath.pyc

ó
Nêáac@sddlmZmZddlmZmZddlZddlZddlZddlm	Z	m
Z
mZmZe
dƒZe
dƒZgddgD](ZddgD]Zeeeƒ^q§q—Zgedfed	feefd	efdefdefd
efeefed	fedfedfed
feefd
efdefdefd	efeefed
fedfgD]\ZZeeeƒ^qŒZgeefed
fedfedfed	feefeefd
efdefdefd	efeefgD]\ZZeeeƒ^q"Zdejfd„ƒYZd
„Zedkr{eƒndS(iÿÿÿÿ(trun_unittesttcpython_only(tparse_testfilet	test_fileN(tphasetpolartrecttpitinftnangg€gffffff@gffffffÀt
CMathTestscBs"eZgdddddddddd	d
ddd
ddgD]Zeeeƒ^q=Zejd„ƒejd„ƒd„Zd„Zddd%d„Z
d„Zd„Zd„Z
d„Zd„Zd„Zd„Zed„ƒZd„Zd „Zd!„Zd"„Zd#„Zd$„ZRS(&tacostacoshtasintasinhtatantatanhtcostcoshtexptlogtlog10tsintsinhtsqrtttanttanhcCstj|dƒS(Ng›@yy›@(tcmathR(tx((s+/usr/local/lib/python2.7/test/test_cmath.pyt<lambda>7tcCstjd|ƒS(Ng,@y;@y,@;À(RR(R((s+/usr/local/lib/python2.7/test/test_cmath.pyR8RcCsttƒ|_dS(N(topenRttest_values(tself((s+/usr/local/lib/python2.7/test/test_cmath.pytsetUp:scCs|jjƒdS(N(R tclose(R!((s+/usr/local/lib/python2.7/test/test_cmath.pyttearDown=sgV瞯â<g
cCsGtj|ƒrAtj|ƒr"dS|j|p:dj|ƒƒntj|ƒr‚||kr`dS|j|p{dj||ƒƒn|rÙ|rÙtjd|ƒtjd|ƒkrÙ|j|pÏdj||ƒƒqÙnyt||ƒ}Wntk
rn$X|t||t|ƒƒkr$dS|j|p?dj||ƒƒdS(sƒFail if the two floating-point numbers are not almost equal.

        Determine whether floating-point values a and b are equal to within
        a (small) rounding error.  The default values for rel_err and
        abs_err are chosen to be suitable for platforms where a float is
        represented by an IEEE 754 double.  They allow an error of between
        9 and 19 ulps.
        Ns{!r} should be nans>finite result where infinity expected: expected {!r}, got {!r}gð?s,zero has wrong sign: expected {!r}, got {!r}s({!r} and {!r} are not sufficiently close(	tmathtisnantfailtformattisinftcopysigntabst
OverflowErrortmax(R!tatbtrel_errtabs_errtmsgtabsolute_error((s+/usr/local/lib/python2.7/test/test_cmath.pytrAssertAlmostEqual@s*$
c	Csld}d}|jtj|ddddjtj|ƒƒ|jtj|ddddjtj|ƒƒdS(NgiW‹
¿@g-DTû!	@tplacesi	R2scmath.pi is {}; should be {}scmath.e is {}; should be {}(tassertAlmostEqualRRR(te(R!t
e_expectedtpi_expected((s+/usr/local/lib/python2.7/test/test_cmath.pyttest_constantsrscsÿd"‰d‰dddddtƒtg}dtfd	„ƒY}d
d#d„ƒY}dtfd
„ƒY‰dtf‡fd†ƒY}dd$‡fd†ƒY}dtfd„ƒY}dd%d„ƒY}dtfd„ƒY}dd&d„ƒY}	dtf‡‡fd†ƒY}
dd'‡‡fd†ƒY}dtf‡fd†ƒY}d d(‡fd!†ƒY}
x˜|jD]}|j||ˆƒƒ|ˆƒƒ|j||ˆƒƒ|ˆƒƒ|j||
ƒƒ|ˆƒƒ|j||ƒƒ|ˆƒƒ|j||ƒƒ|ˆƒƒ|j||
ƒƒ|ˆƒƒ|jt||ƒƒ|jt||ƒƒ|jt||ƒƒ|jt||	ƒƒx@|D]8}|jt|||ƒƒ|jt|||ƒƒqW|jˆ||ƒƒ|jˆ||ƒƒqjWdS()Ng—æ‹úz­@y7Ä‚?ô÷?g]ò‰†Ö†Àsnot complexilg@t	MyComplexcBseZd„Zd„ZRS(cSs
||_dS(N(tvalue(R!R<((s+/usr/local/lib/python2.7/test/test_cmath.pyt__init__ŽscSs|jS(N(R<(R!((s+/usr/local/lib/python2.7/test/test_cmath.pyt__complex__s(t__name__t
__module__R=R>(((s+/usr/local/lib/python2.7/test/test_cmath.pyR;s	tMyComplexOScBseZd„Zd„ZRS(cSs
||_dS(N(R<(R!R<((s+/usr/local/lib/python2.7/test/test_cmath.pyR=•scSs|jS(N(R<(R!((s+/usr/local/lib/python2.7/test/test_cmath.pyR>—s(R?R@R=R>(((s+/usr/local/lib/python2.7/test/test_cmath.pyRA”s	t
SomeExceptioncBseZRS((R?R@(((s+/usr/local/lib/python2.7/test/test_cmath.pyRB›stMyComplexExceptioncseZ‡fd†ZRS(cs
ˆ‚dS(N((R!(RB(s+/usr/local/lib/python2.7/test/test_cmath.pyR>žs(R?R@R>((RB(s+/usr/local/lib/python2.7/test/test_cmath.pyRCstMyComplexExceptionOScseZ‡fd†ZRS(cs
ˆ‚dS(N((R!(RB(s+/usr/local/lib/python2.7/test/test_cmath.pyR>¡s(R?R@R>((RB(s+/usr/local/lib/python2.7/test/test_cmath.pyRD stNeitherComplexNorFloatcBseZRS((R?R@(((s+/usr/local/lib/python2.7/test/test_cmath.pyRE¥stNeitherComplexNorFloatOScBseZRS((R?R@(((s+/usr/local/lib/python2.7/test/test_cmath.pyRF§stMyIntcBs#eZd„Zd„Zd„ZRS(cSsdS(Ni((R!((s+/usr/local/lib/python2.7/test/test_cmath.pyt__int__ªRcSsdS(Nl((R!((s+/usr/local/lib/python2.7/test/test_cmath.pyt__long__«RcSsdS(Ni((R!((s+/usr/local/lib/python2.7/test/test_cmath.pyt	__index__¬R(R?R@RHRIRJ(((s+/usr/local/lib/python2.7/test/test_cmath.pyRG©s		tMyIntOScBs#eZd„Zd„Zd„ZRS(cSsdS(Ni((R!((s+/usr/local/lib/python2.7/test/test_cmath.pyRH®RcSsdS(Nl((R!((s+/usr/local/lib/python2.7/test/test_cmath.pyRI¯RcSsdS(Ni((R!((s+/usr/local/lib/python2.7/test/test_cmath.pyRJ°R(R?R@RHRIRJ(((s+/usr/local/lib/python2.7/test/test_cmath.pyRK­s		tFloatAndComplexcs&eZ‡fd†Z‡fd†ZRS(csˆS(N((R!(tflt_arg(s+/usr/local/lib/python2.7/test/test_cmath.pyt	__float__µscsˆS(N((R!(tcx_arg(s+/usr/local/lib/python2.7/test/test_cmath.pyR>·s(R?R@RNR>((RORM(s+/usr/local/lib/python2.7/test/test_cmath.pyRL´stFloatAndComplexOScs&eZ‡fd†Z‡fd†ZRS(csˆS(N((R!(RM(s+/usr/local/lib/python2.7/test/test_cmath.pyRNºscsˆS(N((R!(RO(s+/usr/local/lib/python2.7/test/test_cmath.pyR>¼s(R?R@RNR>((RORM(s+/usr/local/lib/python2.7/test/test_cmath.pyRP¹st	JustFloatcseZ‡fd†ZRS(csˆS(N((R!(RM(s+/usr/local/lib/python2.7/test/test_cmath.pyRN¿s(R?R@RN((RM(s+/usr/local/lib/python2.7/test/test_cmath.pyRQ¾stJustFloatOScseZ‡fd†ZRS(csˆS(N((R!(RM(s+/usr/local/lib/python2.7/test/test_cmath.pyRNÂs(R?R@RN((RM(s+/usr/local/lib/python2.7/test/test_cmath.pyRRÁsy—æ‹úz­@7Ä‚?ô÷?(((((((tNonetobjecttNotImplementedt	Exceptionttest_functionstassertEqualtassertRaisest	TypeError(R!t
non_complexesR;RARCRDRERFRGRKRLRPRQRRtftbad_complex((RBRORMs+/usr/local/lib/python2.7/test/test_cmath.pyttest_user_objectzsB""
cCs›xM|jD]B}x9dddgD](}|j||ƒ||jƒƒƒq Wq
WxD|jD]9}x0dddddgD]}|jt||ƒqvWqZWdS(	Nilg@R.tlong_stringt0t1jR(RWRXRNRYRZ(R!R\targ((s+/usr/local/lib/python2.7/test/test_cmath.pyttest_input_typeßs*cCsõddddddg}|g|D]
}|^q"ddd	g}|dgg|D]}d|^qT}dg|}dg|g|D]
}|^q‰}i
|d
6|d6|d6|d
6|d6|d6|d6|d6|d6|d6|d6|d6|d6}x|jƒD]s\}}	tt|ƒ}
tt|ƒ}xF|	D]>}||ƒ}
|j|
|ƒ|
jƒ|jd|
jƒq<WqWxldddgD][}xR|D]J}tj||ƒ}
|jtj||ƒ|
jƒ|jd|
jƒqŸWq’WdS(Ng{®Gáz„?gš™™™™™¹?gš™™™™™É?gà?gÍÌÌÌÌÌì?g®Gáz®ï?ggð?gð¿RR
RRRRRRRRRRRg@g$@(	titemstgetattrR%RR4trealRXtimagR(R!R Rt
unit_intervaltpositivetnonnegativet	real_lineRWtfntvaluestfloat_fnt
complex_fntvtztbase((s+/usr/local/lib/python2.7/test/test_cmath.pyttest_cmath_matches_mathës@(
%


c
Cs–tjdƒjdƒs(|jdƒnd„}d„}xUttƒD]G\}}}}}}}	t||ƒ}
t||ƒ}|dkr•|}n$|dkrª|}ntt|ƒ}d|	ksÑd	|	kry||
ƒ}
Wnt	k
r÷qGqX|j
d
j||||ƒƒnd|	kroy||
ƒ}
Wntk
rLqGqoX|j
dj||||ƒƒn||
ƒ}
d
|	krÀtt
|
jƒ|
jƒ}
tt
|jƒ|jƒ}nd|	krt|
jt
|
jƒƒ}
t|jt
|jƒƒ}n|dkrd}nd}dj|||||j|j|
j|
jƒ}|j|j|
jd|d|ƒ|j|j|
jd|ƒqGWdS(NtdoubletIEEEsneeds IEEE doublecSstj|j|jƒS(saWrapped version of rect that accepts a complex number instead of
            two float arguments.(RRRfRg(Rq((s+/usr/local/lib/python2.7/test/test_cmath.pytrect_complexscSstt|ƒŒS(sYWrapped version of polar that returns a complex number instead of
            two floats.(tcomplexR(Rq((s+/usr/local/lib/python2.7/test/test_cmath.pyt
polar_complex$sRRsdivide-by-zerotinvalids9ValueError not raised in test {}: {}(complex({!r}, {!r}))toverflows<OverflowError not raised in test {}: {}(complex({!r}, {!r}))signore-real-signsignore-imag-signRRgV瞯â<g
sŽ{}: {}(complex({!r}, {!r}))
Expected: complex({!r}, {!r})
Received: complex({!r}, {!r})
Received value insufficiently close to expected value.R1R2(RR(tfloatt
__getformat__t
startswithtskipTestRRRwReRt
ValueErrorR'R(R,R+RfRgR4(R!RvRxtidRltartaiterteitflagsRbtexpectedtfunctiontactualtreal_abs_errt
error_message((s+/usr/local/lib/python2.7/test/test_cmath.pyttest_specific_valuessZ		(		

	csX‡‡fd†}|ddƒ|ddƒ|ddtfƒ|ddtdfƒ|d	d
tdfƒtdƒ}|t|dƒ|dfƒ|t|dƒ|tfƒ|td|ƒ|tdfƒ|td
|ƒ|tdfƒ|t||ƒ|tdfƒ|t||ƒ|tdfƒ|t||ƒ|dtdfƒ|t||ƒ|dtdfƒtdƒ}|t|dƒ||fƒ|td|ƒ||fƒ|t||ƒ||fƒ|t||ƒ||fƒ|t||ƒ||fƒ|t||ƒ||fƒ|t||ƒ||fƒdS(Ncs@ˆ|ƒ}x-t||ƒD]\}}ˆj||ƒqWdS(N(tzipR4(RbR†tgotR7tg(tfuncR!(s+/usr/local/lib/python2.7/test/test_cmath.pytcheckcsigigð?iÿÿÿÿyð?iyÀg@RiiiiýÿÿÿR	(gg(gð?g(RR{Rw(R!RRRR	((RR!s+/usr/local/lib/python2.7/test/test_cmath.pytcheck_polarbs.

 " "%&cCs|jtƒdS(N(R‘R(R!((s+/usr/local/lib/python2.7/test/test_cmath.pyt
test_polar~scs0ddlm‰‡fd†}|j|ƒdS(Niÿÿÿÿ(t	set_errnocs*ˆdƒzt|ƒSWdˆdƒXdS(Nii(R(Rq(R“(s+/usr/local/lib/python2.7/test/test_cmath.pytpolar_with_errno_set…s
(t	_testcapiR“R‘(R!R”((R“s+/usr/local/lib/python2.7/test/test_cmath.pyttest_polar_errnoscCs|jtdƒdƒ|jtdƒdƒ|jtdƒtƒ|jtdƒtƒ|jtdƒtƒ|jtdƒtdƒ|jtdƒtdƒ|jttddƒƒdƒ|jttdd	ƒƒd	ƒ|jttd	dƒƒtƒ|jttd	d	ƒƒtƒ|jtttd	ƒƒtƒ|jtttd
ƒƒtƒ|jttttƒƒdtƒ|jttd
tƒƒtdƒ|jttd	tƒƒtdƒ|jttdtƒƒtdƒ|jttdtƒƒtdƒ|jttttƒƒtd
ƒ|jtttd
ƒƒd	ƒ|jtttd	ƒƒd	ƒ|jtttdƒƒdƒ|jtttdƒƒdƒ|jttttƒƒtd
ƒ|jttdtƒƒtdƒ|jttdtƒƒtdƒ|jttd	tƒƒtdƒ|jttd
tƒƒtdƒ|jttttƒƒdtƒ|jtttdƒƒtƒ|jtttdƒƒtƒx*tD]"}|jtj	t|ƒƒƒq×WdS(Niggð?gð¿yYóøÂn¥yð?iyð¿g€gffffffÀgè¿gffffff@igè?yð¿YóøÂn¥yð¿YóøÂn¥(
R6RRRXRwtINFtcomplex_nanst
assertTrueR%R&(R!Rq((s+/usr/local/lib/python2.7/test/test_cmath.pyt
test_phasesB !!%%%%%%#####$  
cCsTx$tD]}|jt|ƒdƒqWx$tD]}|jt|ƒtƒq.W|jttttƒƒtƒ|jtj	tttdƒƒƒƒ|jtj	tttdƒƒƒƒ|jtj	tttdƒƒƒƒ|jtj	tttdƒƒƒƒ|jttttƒƒtƒ|jttttƒƒtƒ|jtj	ttdtƒƒƒƒ|jtj	ttdtƒƒƒƒ|jtj	ttdtƒƒƒƒ|jtj	ttdtƒƒƒƒ|jttttƒƒtƒ|jtj	ttttƒƒƒƒt
jdƒjdƒrP|j
tttddƒƒndS(NggffffffÀg€gffffff@RtRug­åU»ëè(t
complex_zerosRXR+tcomplex_infinitiesR—RwtNANR™R%R&R{R|R}RYR,(R!Rq((s+/usr/local/lib/python2.7/test/test_cmath.pyttest_abs¶s&

 %%%% %%%%%cCsZd}t|j|dƒ|ks@t|j|dƒ|krV|j||fƒndS(NgH¯¼šò×z>ii(R+RfRgR'(R!R.R/teps((s+/usr/local/lib/python2.7/test/test_cmath.pytassertCEqualÒs:cCs‹|jtddƒdƒ|jtddƒdƒ|jtdtƒdƒ|jtdtdƒd	ƒ|jtdtdƒd
ƒdS(Niigð?gð¿i(ii(gð?i(gð¿i(igð?(igð¿(R RR(R!((s+/usr/local/lib/python2.7/test/test_cmath.pyt	test_rect×s
cCs÷|jtjdƒƒ|jtjdƒƒ|jtjtƒƒ|jtjtƒƒ|jtjttdƒƒƒ|jtjtdtƒƒƒ|jtjtttƒƒƒ|jtjtttƒƒƒ|jtjtttƒƒƒdS(Niyð?i(tassertFalseRR&R—R™RRw(R!((s+/usr/local/lib/python2.7/test/test_cmath.pyt
test_isnanÞscCs÷|jtjdƒƒ|jtjdƒƒ|jtjtƒƒ|jtjtƒƒ|jtjttdƒƒƒ|jtjtdtƒƒƒ|jtjtttƒƒƒ|jtjtttƒƒƒ|jtjtttƒƒƒdS(Niyð?i(R¢RR)RR™R—Rw(R!((s+/usr/local/lib/python2.7/test/test_cmath.pyt
test_isinfésN(R?R@tfnameReRRWtappendR"R$RSR4R:R^RcRsR‹R‘R’RR–RšRžR R¡R£R¤(((s+/usr/local/lib/python2.7/test/test_cmath.pyR
0s0(		1		e		0	G			)				cCsttƒdS(N(RR
(((s+/usr/local/lib/python2.7/test/test_cmath.pyt	test_mainõst__main__(ttest.test_supportRRttest.test_mathRRtunittestRR%RRRRR{R—RRtyRwR›RœR˜tTestCaseR
R§R?(((s+/usr/local/lib/python2.7/test/test_cmath.pyt<module>s\";							









	.
					
				.ÿÆ	

Zerion Mini Shell 1.0