1 // most_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 most_positive_LF (uintC len)
22 var Lfloat erg = allocate_lfloat(len,LF_exp_high,0);
23 fill_loop_up(&TheLfloat(erg)->data[0],len,~(uintD)0);
27 const cl_F most_positive_float (float_format_t f)
29 // Exponent so groß wie möglich, Mantisse 1...1, Vorzeichen +.
31 static const cl_SF most_positive_SF =
32 make_SF(0,SF_exp_high,bit(SF_mant_len+1)-1);
34 static const cl_FF most_positive_FF =
35 encode_FF(0,FF_exp_high-FF_exp_mid,bit(FF_mant_len+1)-1);
37 static const cl_DF most_positive_DF =
38 #if (cl_word_size==64)
39 encode_DF(0,DF_exp_high-DF_exp_mid,bit(DF_mant_len+1)-1);
41 encode_DF(0,DF_exp_high-DF_exp_mid,bit(DF_mant_len-32+1)-1,bitm(32)-1);
44 floatformatcase((uintC)f
45 , return most_positive_SF;
46 , return most_positive_FF;
47 , return most_positive_DF;
48 , return most_positive_LF(len);