]> www.ginac.de Git - cln.git/blob - src/real/misc/cl_R_contagion.cc
Finalize CLN 1.3.7 release.
[cln.git] / src / real / misc / cl_R_contagion.cc
1 // contagion().
2
3 // General includes.
4 #include "base/cl_sysdep.h"
5
6 // Specification.
7 #include "real/cl_R.h"
8
9
10 // Implementation.
11
12 #include "float/lfloat/cl_LF.h"
13
14 namespace cln {
15
16 const cl_R contagion (const cl_R& x, const cl_R& y)
17 {
18 #define X  { return x; }
19 #define Y  { return y; }
20 #if 0
21         if (R_rationalp(x)) Y
22         elif (R_rationalp(y)) X
23         else
24                 floattypecase(x
25                 , X // floattypecase(y, X,X,X,X)
26                 , floattypecase(y, Y,X,X,X)
27                 , floattypecase(y, Y,Y,X,X)
28                 , floattypecase(y, Y,Y,Y,
29                         if (TheLfloat(x)->len <= TheLfloat(y)->len) X else Y
30                         )
31                 );
32 #else // faster type dispatch
33         realtypecase(x
34         ,       Y
35         ,       Y
36         ,       Y
37         ,       X // realtypecase(y, X,X,X, X,X,X,X)
38         ,       realtypecase(y, X,X,X, Y,X,X,X)
39         ,       realtypecase(y, X,X,X, Y,Y,X,X)
40         ,       realtypecase(y, X,X,X, Y,Y,Y,
41                         if (TheLfloat(x)->len <= TheLfloat(y)->len) X else Y
42                         )
43         );
44 #endif
45 }
46
47 }  // namespace cln