MMCT TEAM
Server IP : 103.53.40.154  /  Your IP : 3.143.23.38
Web Server : Apache
System : Linux md-in-35.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : ppcad7no ( 715)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /../sys/../lib64/libproxy/../python2.7/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //../sys/../lib64/libproxy/../python2.7/fpformat.pyc
�
m��fc@s�dZddlmZeddd�[ddlZddd	gZejd
�Zyd	efd��YZWne	k
r�dZnXd
�Z
d�Zd�Zd�Z
d�Zd�ZdS(s8General floating point formatting functions.

Functions:
fix(x, digits_behind)
sci(x, digits_behind)

Each takes a number or a string and a number of digits as arguments.

Parameters:
x:             number to be formatted; or a string resembling a number
digits_behind: number of digits behind the decimal point
i����(twarnpy3ks2the fpformat module has been removed in Python 3.0t
stackleveliNtfixtscit
NotANumbers-^([-+]?)0*(\d*)((?:\.\d*)?)(([eE][-+]?\d+)?)$cBseZRS((t__name__t
__module__(((s /usr/lib64/python2.7/fpformat.pyRssfpformat.NotANumbercCs�tj|�}|dkr't|�n|jdddd�\}}}}|dkr`d}n|rs|d}n|r�t|d�}nd}||||fS(	s�Return (sign, intpart, fraction, expo) or raise an exception:
    sign is '+' or '-'
    intpart is 0 or more digits beginning with a nonzero
    fraction is 0 or more digits
    expo is an integeriiiit+tiN(tdecodertmatchtNoneRtgrouptint(tstrestsigntintparttfractiontexpparttexpo((s /usr/lib64/python2.7/fpformat.pytextract#s$	
cCs�|dkrUt|�}||| ||}}||kr�|d||}q�nW|dkr�t|�}|| |||}}||kr�d|||}q�n||fS(s5Remove the exponent by changing intpart and fraction.it0(tlen(RRRtfti((s /usr/lib64/python2.7/fpformat.pytunexpo2s
cCs[t|�}||kr.||d||fSt|�}||dkrYd|dfS||}|||}|dkr&||d}xH|dkr�||dkr�Pn|d}q�Wd|}|d}d}|| tt||�d�dt|�|d}|| ||}}n|dkr@||| fS|| d|dfSdS(s*Round or extend the fraction to size digs.RiRt5it9N(Rtchrtord(RRtdigsRRttotalt	nextdigittn((s /usr/lib64/python2.7/fpformat.pyt	roundfrac@s,


8cCs�t|�td�kr't|�}nyt|�\}}}}Wntk
rW|SXt|||�\}}t|||�\}}x$|r�|ddkr�|d}q�W|dkr�d}n|dkr�||d|S||SdS(s�Format x as [-]ddd.ddd with 'digs' digits after the point
    and at least one digit before.
    If digs <= 0, the point is suppressed.RiRit.N(ttypetreprRRRR#(txRRRRR((s /usr/lib64/python2.7/fpformat.pyRZs
	cCs�t|�td�kr't|�}nt|�\}}}}|s�x.|ru|ddkru|d}|d}qHW|r�|d|d}}|d}q�d}n-|t|�d}|d|d|}}td|�}t|||�\}}t|�dkrB|d|d|d |t|�d}}}n||}|dkri|d|}ntt|��}ddt|�|}|dkr�d|}n
d	|}|d
|S(s�Format x as [-]d.dddE[+-]ddd with 'digs' digits after the point
    and exactly one digit before.
    If digs is <= 0, one digit is kept and the point is suppressed.RiRii����R$it-Rte(R%R&RRtmaxR#tabs(R'RRRRRRR)((s /usr/lib64/python2.7/fpformat.pyRjs6

	


cCsYy;x4td�\}}|Gt||�Gt||�GHqWnttfk
rTnXdS(sInteractive test run.sEnter (x, digs): N(tinputRRtEOFErrortKeyboardInterrupt(R'R((s /usr/lib64/python2.7/fpformat.pyttest�s&(t__doc__twarningsRtret__all__tcompileR	t
ValueErrorRt	TypeErrorRRR#RRR/(((s /usr/lib64/python2.7/fpformat.pyt<module>s 

					 

MMCT - 2023