]> www.ginac.de Git - cln.git/blob - src/float/ffloat/elem/cl_FF_globals.cc
Finalize CLN 1.3.7 release.
[cln.git] / src / float / ffloat / elem / cl_FF_globals.cc
1 // Global variables for cl_FF.
2
3 // General includes.
4 #include "base/cl_sysdep.h"
5
6 // Specification.
7 #include "cln/ffloat_class.h"
8 #include "float/ffloat/cl_FF.h"
9
10
11 // Implementation.
12
13 namespace cln {
14
15 #if !defined(CL_WIDE_POINTERS)
16
17 const cl_FF cl_FF_0 = cl_FF_0; // 0.0f0
18
19 const cl_FF cl_FF_1 = cl_FF_1; // 1.0f0
20
21 const cl_FF cl_FF_minus1 = cl_FF_minus1; // -1.0f0
22
23 int cl_FF_globals_init_helper::count = 0;
24
25 cl_FF_globals_init_helper::cl_FF_globals_init_helper()
26 {
27         if (count++ == 0) {
28                 new ((void *)&cl_FF_0) cl_FF(allocate_ffloat(0)); // 0.0f0
29                 new ((void *)&cl_FF_1) cl_FF(encode_FF(0,1,bit(FF_mant_len))); // 1.0f0
30                 new ((void *)&cl_FF_minus1) cl_FF(encode_FF(-1,1,bit(FF_mant_len))); // -1.0f0
31         }
32 }
33
34 cl_FF_globals_init_helper::~cl_FF_globals_init_helper()
35 {
36         if (--count == 0) {
37                 // Nothing to clean up
38         }
39 }
40 #endif
41
42 }  // namespace cln
43