]> www.ginac.de Git - cln.git/blob - src/float/misc/cl_F_mostneg.cc
* All Files have been modified for inclusion of namespace cln;
[cln.git] / src / float / misc / cl_F_mostneg.cc
1 // most_negative_float().
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 CL_PROVIDE(cl_F_mostneg)
7
8 // Specification.
9 #include "cln/float.h"
10
11 // Implementation.
12
13 #include "cl_F.h"
14 #include "cl_SF.h"
15 #include "cl_FF.h"
16 #include "cl_DF.h"
17 #include "cl_LF.h"
18 #include "cl_LF_impl.h"
19
20 namespace cln {
21
22 // Exponent so groß wie möglich, Mantisse 1...1, Vorzeichen -.
23
24 static const cl_SF most_negative_SF =
25         make_SF(-1,SF_exp_high,bit(SF_mant_len+1)-1);
26
27 static const cl_FF most_negative_FF =
28         encode_FF(-1,FF_exp_high-FF_exp_mid,bit(FF_mant_len+1)-1);
29
30 static const cl_DF most_negative_DF =
31 #if (cl_word_size==64)
32         encode_DF(-1,DF_exp_high-DF_exp_mid,bit(DF_mant_len+1)-1);
33 #else
34         encode_DF(-1,DF_exp_high-DF_exp_mid,bit(DF_mant_len-32+1)-1,bitm(32)-1);
35 #endif
36
37 inline const cl_LF most_negative_LF (uintC len)
38 {
39         var Lfloat erg = allocate_lfloat(len,LF_exp_high,-1);
40         fill_loop_up(&TheLfloat(erg)->data[0],len,~(uintD)0);
41         return erg;
42 }
43
44 const cl_F most_negative_float (float_format_t f)
45 {
46         floatformatcase((uintL)f
47         ,       return most_negative_SF;
48         ,       return most_negative_FF;
49         ,       return most_negative_DF;
50         ,       return most_negative_LF(len);
51         );
52 }
53
54 }  // namespace cln
55
56 CL_PROVIDE_END(cl_F_mostneg)