b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 104.21.65.202 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 /
Filename/usr/lib64/python2.6/fpformat.pyc
Size4.62 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed22-Apr-2026 05:26
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc@sÃdZddklZeddd�[ddkZddd gZeid
�Zyd efd ��YZWne j
o
d ZnXd
�Z
d�Z d�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.6/fpformat.pyRssfpformat.NotANumbercCsªti|�}|djo
t|�n|idddd�\}}}}|djo
d}n|o|d}n|ot|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.6/fpformat.pytextract#s

$

cCs¾|djoLt|�}||| ||}}||jo|d||}q´n\|djoNt|�}|| |||}}|| jod| ||}q´n||fS(s5Remove the exponent by changing intpart and fraction.it0(tlen(RRRtfti((s /usr/lib64/python2.6/fpformat.pytunexpo2s
 

 cCsgt|�}||jo||d||fSt|�}||djod| dfS||}|||}|djo®||d}xL|djo$||djoPn|d}q�Wd|}|d}d}|| tt||�d�dt|�|d}|| ||}}n|djo||| fS|| d| dfSdS(s*Round or extend the fraction to size digs.RiRt5it9N(Rtchrtord(RRtdigsRRttotalt nextdigittn((s /usr/lib64/python2.6/fpformat.pyt roundfrac@s. 
 




8
cCs÷t|�td�jot|�}nyt|�\}}}}Wntj
o|SXt|||�\}}t|||�\}}x'|o|ddjo|d}q�W|djo
d}n|djo||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.6/fpformat.pyRZs 


cCsÑt|�td�jot|�}nt|�\}}}}|phx1|o)|ddjo|d}|d}qKW|o#|d|d}}|d}qÝd}n.|t|�d}|d|d|}}td|�}t|||�\}}t|�djo6|d|d|d |t|�d}}}n||}|djo|d|}ntt|��}ddt|�|}|djod|}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.6/fpformat.pyRjs8

 



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