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