PageRenderTime 21ms CodeModel.GetById 15ms app.highlight 5ms RepoModel.GetById 0ms app.codeStats 0ms

/cln-1.3.2/src/real/conv/cl_F_from_R.cc

#
C++ | 50 lines | 31 code | 15 blank | 4 comment | 2 complexity | fe2db91378ee73fe7731f87f44483e80 MD5 | raw file
Possible License(s): GPL-2.0
 1// cl_float().
 2
 3// General includes.
 4#include "base/cl_sysdep.h"
 5
 6// Specification.
 7#include "cln/real.h"
 8
 9
10// Implementation.
11
12#include "real/cl_R.h"
13
14#if 0
15
16namespace cln {
17
18const cl_F cl_float (const cl_R& x, const cl_F& y)
19{
20	if (rationalp(x)) {
21		DeclareType(cl_RA,x);
22		return cl_float(x,y);
23	} else {
24		DeclareType(cl_F,x);
25		return cl_float(x,y);
26	}
27}
28
29}  // namespace cln
30
31#else // less type dispatch overhead
32
33#include "float/cl_F.h"
34#include "float/lfloat/cl_LF.h"
35
36namespace cln {
37
38const cl_F cl_float (const cl_R& x, const cl_F& y)
39{
40	floattypecase(y
41	,	return cl_R_to_SF(x);
42	,	return cl_R_to_FF(x);
43	,	return cl_R_to_DF(x);
44	,	return cl_R_to_LF(x,TheLfloat(y)->len);
45	);
46}
47
48}  // namespace cln
49
50#endif