]> www.ginac.de Git - cln.git/blob - src/float/dfloat/misc/cl_DF_as.cc
d3efc2ddf0337324873f697410a2a549f901491e
[cln.git] / src / float / dfloat / misc / cl_DF_as.cc
1 // cl_DF_As().
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cln/dfloat.h"
8
9
10 // Implementation.
11
12 #include "cl_N.h"
13
14 namespace cln {
15
16 inline cl_boolean cl_DF_p (const cl_number& x)
17 {
18         if (x.pointer_p())
19                 if (x.heappointer->type == &cl_class_dfloat)
20                         return cl_true;
21         return cl_false;
22 }
23
24 const cl_DF& cl_DF_As (const cl_number& x, const char * filename, int line)
25 {
26         if (cl_DF_p(x)) {
27                 DeclareType(cl_DF,x);
28                 return x;
29         } else
30                 cl_as_error(x,"a double-float number",filename,line);
31 }
32
33 }  // namespace cln