1 // float_negative_epsilon().
6 CL_PROVIDE(cl_F_epsneg)
18 #include "cl_LF_impl.h"
22 // Bei Floats mit d Bits (incl. Hiddem Bit, also d = ?F_mant_len+1)
23 // ist ?F_negative_epsilon = 2^(-d-1)*(1+2^(1-d)),
24 // d.h. Mantisse 10...01, Vorzeichen +.
26 static const cl_SF SF_negative_epsilon =
27 make_SF(0,SF_exp_mid-SF_mant_len-1,bit(SF_mant_len)+1);
29 static const cl_FF FF_negative_epsilon =
30 encode_FF(0,-FF_mant_len-1,bit(FF_mant_len)+1);
32 static const cl_DF DF_negative_epsilon =
33 #if (cl_word_size==64)
34 encode_DF(0,-DF_mant_len-1,bit(DF_mant_len)+1);
36 encode_DF(0,-DF_mant_len-1,bit(DF_mant_len-32),1);
39 inline const cl_LF LF_negative_epsilon (uintC len)
41 var Lfloat erg = allocate_lfloat(len,LF_exp_mid-intDsize*len,0);
42 var uintD* ptr = &TheLfloat(erg)->data[0];
43 #if CL_DS_BIG_ENDIAN_P
44 *ptr++ = bit(intDsize-1);
45 ptr = clear_loop_up(ptr,len-2);
49 ptr = clear_loop_up(ptr,len-2);
50 *ptr = bit(intDsize-1);
55 const cl_F float_negative_epsilon (float_format_t f)
57 floatformatcase((uintC)f
58 , return SF_negative_epsilon;
59 , return FF_negative_epsilon;
60 , return DF_negative_epsilon;
61 , return LF_negative_epsilon(len);
67 CL_PROVIDE_END(cl_F_epsneg)