1 // least_positive_float().
4 #include "base/cl_sysdep.h"
11 #include "float/cl_F.h"
12 #include "float/sfloat/cl_SF.h"
13 #include "float/ffloat/cl_FF.h"
14 #include "float/dfloat/cl_DF.h"
15 #include "float/lfloat/cl_LF.h"
16 #include "float/lfloat/cl_LF_impl.h"
20 static inline const cl_LF least_positive_LF (uintC len)
22 var Lfloat erg = allocate_lfloat(len,LF_exp_low,0);
23 #if CL_DS_BIG_ENDIAN_P
24 TheLfloat(erg)->data[0] = bit(intDsize-1);
25 clear_loop_up(&TheLfloat(erg)->data[1],len-1);
27 var uintD* ptr = clear_loop_up(&TheLfloat(erg)->data[0],len-1);
28 *ptr = bit(intDsize-1);
33 const cl_F least_positive_float (float_format_t f)
35 // Exponent so klein wie möglich, Mantisse 10...0, Vorzeichen +.
37 static const cl_SF least_positive_SF =
38 make_SF(0,SF_exp_low,bit(SF_mant_len));
40 static const cl_FF least_positive_FF =
41 encode_FF(0,FF_exp_low-FF_exp_mid,bit(FF_mant_len));
43 static const cl_DF least_positive_DF =
44 #if (cl_word_size==64)
45 encode_DF(0,DF_exp_low-DF_exp_mid,bit(DF_mant_len));
47 encode_DF(0,DF_exp_low-DF_exp_mid,bit(DF_mant_len-32),0);
50 floatformatcase((uintC)f
51 , return least_positive_SF;
52 , return least_positive_FF;
53 , return least_positive_DF;
54 , return least_positive_LF(len);