]> www.ginac.de Git - cln.git/blob - src/real/conv/cl_R_to_float.cc
f5b852fdb5662f4fc4b4591f3992a3a38af6c2b1
[cln.git] / src / real / conv / cl_R_to_float.cc
1 // cl_R_to_float().
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cln/real.h"
8
9
10 // Implementation.
11
12 #include "cl_R.h"
13 #include "cl_F.h"
14 #include "cln/integer.h"
15 #include "cln/rational.h"
16 #include "cln/float.h"
17 #include "cln/sfloat.h"
18 #include "cln/ffloat.h"
19 #include "cln/dfloat.h"
20 #include "cln/lfloat.h"
21
22 #if 0
23
24 namespace cln {
25
26 float float_approx (const cl_R& x)
27 {
28         if (rationalp(x)) {
29                 DeclareType(cl_RA,x);
30                 return float_approx(x);
31         } else {
32                 DeclareType(cl_F,x);
33                 return float_approx(x);
34         }
35 }
36
37 }  // namespace cln
38
39 #else // fully inlined, faster
40
41 #include "cl_RA.h"
42 #include "cl_I.h"
43
44 namespace cln {
45
46 float float_approx (const cl_R& x)
47 {
48         realcase6(x
49         ,       return float_approx(x);
50         ,       return float_approx(x);
51         ,       return float_approx(x);
52         ,       return float_approx(x);
53         ,       return float_approx(x);
54         ,       return float_approx(x);
55         );
56 }
57
58 }  // namespace cln
59
60 #endif