]> www.ginac.de Git - cln.git/blob - src/real/conv/cl_F_from_R.cc
Initial revision
[cln.git] / src / real / conv / cl_F_from_R.cc
1 // cl_float().
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cl_real.h"
8
9
10 // Implementation.
11
12 #include "cl_R.h"
13
14 #if 0
15
16 const cl_F cl_float (const cl_R& x, const cl_F& y)
17 {
18         if (rationalp(x)) {
19                 DeclareType(cl_RA,x);
20                 return cl_float(x,y);
21         } else {
22                 DeclareType(cl_F,x);
23                 return cl_float(x,y);
24         }
25 }
26
27 #else // less type dispatch overhead
28
29 #include "cl_F.h"
30 #include "cl_LF.h"
31
32 const cl_F cl_float (const cl_R& x, const cl_F& y)
33 {
34         floattypecase(y
35         ,       return cl_R_to_SF(x);
36         ,       return cl_R_to_FF(x);
37         ,       return cl_R_to_DF(x);
38         ,       return cl_R_to_LF(x,TheLfloat(y)->len);
39         );
40 }
41
42 #endif