All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Lib.Krakatau.floatutil.pyc Maven / Gradle / Ivy

There is a newer version: 1.1
Show newest version
?
?HRc@s?ddlZdZdZddfZdefZdefZdefZdefZd?Z	dZ
dZd?Zd?Z
d
?Zd?ZdS(i????NiicCs'|\}\}}|||||fS(N((t.0tstmte((s9/home/alex/projects/github/krakatau/Krakatau/floatutil.pytsii????ii4i???i?cCs&|dkst?tt|??dS(s(returns f such that 2**f <= x < 2**(f+1)ii(tAssertionErrortlentbin(tx((s9/home/alex/projects/github/krakatau/Krakatau/floatutil.pytflogsc
Cs?|\}}}|\}}|dks-t?t|?}|||kr||}|||dkrktS||kr?|||>}|||7}|}n||}	||	?}
||
|	>d}d|	>}||ks?||kr?|
d@r?|
d7}
n|
||	|dfS||kr4|||>}|}n||}	|||krRtS||	?}
||
|	>d}d|	>}||ks?||kr?|
d@r?|
d7}
|
d|>kr?|
d?}
|d7}||kr?tSq?n|
||	|dfSdS(sZRound (unnormalized) magnitude to nearest representable magnitude with ties going to 0 lsbiiN(RR	tZERO_MAGtINF_MAG(
tsizetmagtmbitstemintemaxRRtftdnminRtitrth((s9/home/alex/projects/github/krakatau/Krakatau/floatutil.pytroundMagsH
	


"
	


"



cCs?tj|?rtSttjd|??}tj|d?}tj|?rV|tfS|dkrl|tfStj|?\}}t|d|dd>?}|t	|||f?fSdS(Nigi(
tmathtisnantNANtinttcopysigntisinfRR
tfrexpR(RRtsignRR((s9/home/alex/projects/github/krakatau/Krakatau/floatutil.pytfromRawFloatCs

cCsq|\}\}}|dkrO|tkr4td?S|rFtd?nd}ntj||?}tj||?S(NtNaNtinfg(tNoneRtfloatRtldexpR(tvalRRRR((s9/home/alex/projects/github/krakatau/Krakatau/floatutil.pyt
toRawFloatRs
(iN(iN(NN(ii????i(i4i???i?(RR"RR
RtINFtNINFtZEROtNZEROtsortkeyt
FLOAT_SIZEtDOUBLE_SIZER	RRR&(((s9/home/alex/projects/github/krakatau/Krakatau/floatutil.pyts			)	




© 2015 - 2025 Weber Informatics LLC | Privacy Policy