]> www.ginac.de Git - cln.git/blob - src/float/misc/cl_F_mostneg.cc
Use paths relative the `src' directory in the #include directives.
[cln.git] / src / float / misc / cl_F_mostneg.cc
1 // most_negative_float().
2
3 // General includes.
4 #include "base/cl_sysdep.h"
5
6 // Specification.
7 #include "cln/float.h"
8
9 // Implementation.
10
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"
17
18 namespace cln {
19
20 static inline const cl_LF most_negative_LF (uintC len)
21 {
22         var Lfloat erg = allocate_lfloat(len,LF_exp_high,-1);
23         fill_loop_up(&TheLfloat(erg)->data[0],len,~(uintD)0);
24         return erg;
25 }
26
27 const cl_F most_negative_float (float_format_t f)
28 {
29         // Exponent so groß wie möglich, Mantisse 1...1, Vorzeichen -.
30
31         static const cl_SF most_negative_SF =
32                 make_SF(-1,SF_exp_high,bit(SF_mant_len+1)-1);
33
34         static const cl_FF most_negative_FF =
35                 encode_FF(-1,FF_exp_high-FF_exp_mid,bit(FF_mant_len+1)-1);
36
37         static const cl_DF most_negative_DF =
38 #if (cl_word_size==64)
39                 encode_DF(-1,DF_exp_high-DF_exp_mid,bit(DF_mant_len+1)-1);
40 #else
41                 encode_DF(-1,DF_exp_high-DF_exp_mid,bit(DF_mant_len-32+1)-1,bitm(32)-1);
42 #endif
43
44         floatformatcase((uintC)f
45         ,       return most_negative_SF;
46         ,       return most_negative_FF;
47         ,       return most_negative_DF;
48         ,       return most_negative_LF(len);
49         );
50 }
51
52 }  // namespace cln
53