14 const cl_SF ftruncate (const cl_SF& x)
17 // x = 0.0 oder e<=0 -> Ergebnis 0.0
18 // 1<=e<=16 -> letzte (17-e) Bits der Mantisse auf 0 setzen,
19 // Exponent und Vorzeichen beibehalten
20 // e>=17 -> Ergebnis x
21 var uintL uexp = SF_uexp(x); // e + SF_exp_mid
22 if (uexp <= SF_exp_mid) // 0.0 oder e<=0 ?
25 { if (uexp > SF_exp_mid+SF_mant_len) // e > 16 ?
28 { return cl_SF_from_word(
29 x.word & // Bitmaske: Bits 16-e..0 gelöscht, alle anderen gesetzt
30 ~(bit(SF_mant_len+SF_mant_shift + 1+SF_exp_mid-uexp) - bit(SF_mant_shift))