ó 2ÄÈ[c@`sªdZddlmZmZmZddlZddlZddlZddlZddl m Z ddl Z ddl mZmZmZmZdefd„ƒYZdS(s! Test printing of scalar types. i(tdivisiontabsolute_importtprint_functionN(t TemporaryFile(tassert_t assert_equaltsuppress_warningstdectTestRealScalarscB`sxeZd„Zd„Zd„Zd„Zd„Zejj e j ƒj dƒ ddƒd„ƒZ d „Zd „ZRS( c C`s9ddddtjtj tjg}tjtjtjtjg}ddddgddddgddddgddddgd d d d gd d d d gd d d d gg}x€t||ƒD]o\}}x`t||ƒD]O\}}d jtj |ƒj t |ƒƒ}t t ||ƒƒ|d |ƒqÞWqÂWdS(Ngg€iiÿÿÿÿs0.0s-0.0s1.0s-1.0tinfs-inftnansfor str({}({}))terr_msg(tnpR R tfloat16tfloat32tfloat64t longdoubletziptformattdtypetnametreprRtstr( tselftsvalststypstwantedtwantstvaltwanttstyptmsg((s@/tmp/pip-build-fiC0ax/numpy/numpy/core/tests/test_scalarprint.pyttest_strs%$cC`sId„}|dƒ|dƒ|dƒ|dƒ|dƒ|dƒdS(NcS`sHtttj|ƒƒt|ƒƒtttj|ƒƒt|ƒƒdS(N(RRR RR(tv((s@/tmp/pip-build-fiC0ax/numpy/numpy/core/tests/test_scalarprint.pytcheck%s"gfotÓ­ùñ?gEÖa-&‡?gñh㈵øä>g-Cëâ6?g4&õk Cg€à7yÃAC((RR"((s@/tmp/pip-build-fiC0ax/numpy/numpy/core/tests/test_scalarprint.pyttest_scalar_cutoffs!s      c `sltjdƒ}tdƒ0}t|d|ƒ|jdƒ|jƒ}WdQXt|t|ƒdƒd„}|ƒ‰d‡fd†}tdƒ¶}tdƒ¡}tj tj }} ||t_ t_ t ƒ7} | j t ƒtjd itd 6d |d dƒWdQX|| t_ t_ |jdƒ|jƒjƒ} WdQXWdQXt| ttjd ƒƒƒdS(Ng‡‹™™™™É?sr+ttfileis cs`sdVt‚dS(Ns np.sqrt(2)(tEOFError(((s@/tmp/pip-build-fiC0ax/numpy/numpy/core/tests/test_scalarprint.pyt userinputMstc`s tˆƒS(N(tnext(tprompt(tgen(s@/tmp/pip-build-fiC0ax/numpy/numpy/core/tests/test_scalarprint.pytQstlocalR treadfunctbanneri(R tdoubleRtprinttseektreadRRtsyststdouttstderrRtfiltertDeprecationWarningtcodetinteracttstripRtsqrt( RtxtftoutputR&t input_functfotfet orig_stdoutt orig_stderrtsuptcapture((R*s@/tmp/pip-build-fiC0ax/numpy/numpy/core/tests/test_scalarprint.pyttest_py2_float_print4s(     ) c C`sÞd„}d„}d„}d„}d„}t|dƒdƒt|dƒdƒt|d ƒd ƒt|d ƒd ƒt|d ƒd ƒt|d ƒd ƒt|d ƒdƒt|dddƒdƒt|dddƒdƒt|d ddƒdƒt|d ddƒdƒt|d ddƒdƒt|d ddƒdƒt|d ddƒdƒt|d ddƒdƒt|d|dƒdƒt|d|dƒdƒt|d|dƒdƒt|d|dƒdƒt|d|dƒdƒt|d|dƒd ƒt|d|dƒd!ƒt|d"|d#ƒd$ƒt|d"|d#ƒd%ƒt|d"|d#ƒd&ƒt|d"|d#ƒd%ƒt|d|d'ƒd(ƒt|d|d)ƒd*ƒt|dƒd+ƒt|d,dBd/tdd0ƒd1ƒt|d,dCd/tdd4ƒd5ƒt|tjtjƒj|dƒd6ƒt|tjtjƒj|dƒd7ƒt|tjtjƒjddƒd8ƒt|dd/tdd9ƒd:ƒt|dd/tdd9ƒd:ƒt|dd/tdd9ƒd;ƒt|dd/tdd9ƒd;ƒt|d<d/tdd9ƒd=ƒt|d<d/tdd9ƒd=ƒt|d<d/tdd9ƒd>ƒt|d<d/tdd9ƒd>ƒt|d?d/tdd#d@tƒdAƒdS(DNc[`stjtj|ƒ|S(N(R tformat_float_positionalR(R<tk((s@/tmp/pip-build-fiC0ax/numpy/numpy/core/tests/test_scalarprint.pyR+gsc[`stjtj|ƒ|S(N(R tformat_float_scientificR(R<RH((s@/tmp/pip-build-fiC0ax/numpy/numpy/core/tests/test_scalarprint.pyR+hsc[`stjtj|ƒ|S(N(R RGR(R<RH((s@/tmp/pip-build-fiC0ax/numpy/numpy/core/tests/test_scalarprint.pyR+isc[`stjtj|ƒ|S(N(R RIR(R<RH((s@/tmp/pip-build-fiC0ax/numpy/numpy/core/tests/test_scalarprint.pyR+jscS`sitd6|d6S(Ntuniquet precision(tFalse(tprec((s@/tmp/pip-build-fiC0ax/numpy/numpy/core/tests/test_scalarprint.pyR+lss1.0s1.s1.e+00s10.234s-10.234s 1.0234e+01s -1.0234e+01s1000.0s1000.RKis10.s-10.s1.e+01s-1.e+01is10.23s -1.02e+01s9.9999999999999995e-08is9.8813129168249309e-324s9.9999999999999694e-311s3.14159265358979323846i s 3.1415927410s3.1415927410e+00s 3.1415926536s3.1415926536e+00s 299792458.0is299792448.00000s 2.99792e+08s299792458.00000is3.1415927410125732421875000i2s43.14159265358979311599796346854418516159057617187500s3.141592653589793gà?i~iRJi•s—0.00000000000000000000000000000000000000000000140129846432481707092372958328991613128026194187651577175706828388979108268586060148663818836212158203125iþi4i2s40.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004940656458412465441765687928682213723650598026143247644255856825006755072702087518652998363616359923797965646954457177309266567103559397963987747960107818781263007131903114045278458171678489821036887186360569987307230500063874091535649843873124733972731696151400317153853980741262385655911710266585566867681870395603106249319452715914924553293054565444011274801297099995419319894090804165633245247571478690147267801593552386115501348035264934720193790268107107491703332226844753335720832431936092382893458368060106011506169809753078342277318329247904982524730776375927247874656084778203734469699533647017972677717585125660551199131504891101451037862738167250955837389733598993664809941164205702637090279242767544565229087538682506419718265533447265625s(340282346638528859811704183484516925440.s6179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.s(340282350000000000000000000000000000000.is1.000s 1.000e+00s1.5s1.500s 1.500e+00t324t fractionals324.00i•i2(RRLR tfinfoRtmaxR(Rtfpos32tfsci32tfpos64tfsci64tpreckwd((s@/tmp/pip-build-fiC0ax/numpy/numpy/core/tests/test_scalarprint.pyt test_dragon4cs|     $$!c C`sãtjtjtjg}ttdƒr:|jtjƒntj}tj}x|D]ˆ}t ||dƒddddƒdƒt ||dƒddddƒdƒt ||d ƒddddƒd ƒt ||d ƒd d ƒdƒt ||dƒdt ddƒdƒt ||dƒdt ddƒdƒt ||dƒdt ddddƒdƒt ||dƒdt ddddƒdƒt ||dƒdt ddddƒ|tjkrÀdndƒt ||dƒdt ddddƒdƒt ||dƒdt ddddƒ|tjkr+dndƒt ||dƒddƒdƒt ||dƒdt ddddƒdƒt ||dƒdt ddddƒ|tjkrµdndƒt ||dƒddƒdƒqSWdS(Ntfloat128s1.0tpad_leftit pad_rights 1. s-1.0s -1. s-10.2s -10.2 s1.23e1t exp_digitsis 1.23e+00001RJRKs1.0000s 1.0000e+00s1.ttrimRHt.s1.2s1.2002t0t-t1( R R RRthasattrtappendRXRGRIRRL(Rttpstfpostfscittp((s@/tmp/pip-build-fiC0ax/numpy/numpy/core/tests/test_scalarprint.pyttest_dragon4_interfaceÑs<   %%%$$$$$$$tppc64treasons#only applies to ppc float128 valuesc(C`s7tjdƒ}gtddƒD])}t|tjdt|ƒƒƒ^q}ddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d+g(}t||ƒtjd,ƒtjd-ƒ}tjt|ƒƒ}tt|ƒt|ƒƒt||kƒdS(.Ns(2.123123123123123123123123123123123e-286ii(t2es'1.06156156156156156156156156156157e-286s'1.06156156156156156156156156156158e-287s'1.06156156156156156156156156156159e-288s&1.0615615615615615615615615615616e-289s'1.06156156156156156156156156156157e-290s'1.06156156156156156156156156156156e-291s&1.0615615615615615615615615615616e-292s&1.0615615615615615615615615615615e-293s%1.061561561561561561561561561562e-294s$1.06156156156156156156156156155e-295s#1.0615615615615615615615615616e-296s!1.06156156156156156156156156e-297s!1.06156156156156156156156157e-298s 1.0615615615615615615615616e-299s1.06156156156156156156156e-300s1.06156156156156156156155e-301s1.0615615615615615615616e-302s1.061561561561561561562e-303s1.06156156156156156156e-304s1.0615615615615615618e-305s1.06156156156156156e-306s1.06156156156156157e-307s1.0615615615615616e-308s1.06156156156156e-309s1.06156156156157e-310s1.0615615615616e-311s1.06156156156e-312s1.06156156154e-313s1.0615615616e-314s1.06156156e-315s1.06156155e-316s 1.061562e-317s 1.06156e-318s 1.06155e-319s 1.0617e-320s 1.06e-321s 1.04e-322s1e-323s0.0t2t3(R RXtrangeRRR(RR<titgottexpectedtatb((s@/tmp/pip-build-fiC0ax/numpy/numpy/core/tests/test_scalarprint.pyttest_ppc64_ibm_double_double128ÿs^?  cC`s~tjddƒ}tjddƒ}tt|ƒt|ƒkƒttjt|ƒƒ|ƒttjt|ƒƒ|ƒdS(Niiiòÿÿÿióÿÿÿg?g ?(R RRRR(RR<ty((s@/tmp/pip-build-fiC0ax/numpy/numpy/core/tests/test_scalarprint.pytfloat32_roundtrip;s cC`sKtttjdƒƒtdƒƒtttjdƒƒtdƒkƒdS(Ngš™™™™™¹?g›™™™™™É?gš™™™™™É?(RRR RR(R((s@/tmp/pip-build-fiC0ax/numpy/numpy/core/tests/test_scalarprint.pytfloat64_vs_pythonCs"(t__name__t __module__R R#RFRWRgtpytesttmarktskipiftplatformtmachinet startswithRsRuRv(((s@/tmp/pip-build-fiC0ax/numpy/numpy/core/tests/test_scalarprint.pyRs   / n .; (t__doc__t __future__RRRR8R3R|RyttempfileRtnumpyR t numpy.testingRRRRtobjectR(((s@/tmp/pip-build-fiC0ax/numpy/numpy/core/tests/test_scalarprint.pyts   "