X-Git-Url: https://ginac.de/CLN/cln.git//cln.git?a=blobdiff_plain;f=src%2Ffloat%2Fdfloat%2Fmisc%2Fcl_DF_as.cc;fp=src%2Ffloat%2Fdfloat%2Fmisc%2Fcl_DF_as.cc;h=e60dc9f2a740cefb331a4e1469a7ea89abc8a09d;hb=dd9e0f894eec7e2a8cf85078330ddc0a6639090b;hp=0000000000000000000000000000000000000000;hpb=d57000b193438122b366aa0d450674be9402d06c;p=cln.git diff --git a/src/float/dfloat/misc/cl_DF_as.cc b/src/float/dfloat/misc/cl_DF_as.cc new file mode 100644 index 0000000..e60dc9f --- /dev/null +++ b/src/float/dfloat/misc/cl_DF_as.cc @@ -0,0 +1,29 @@ +// as_cl_DF(). + +// General includes. +#include "cl_sysdep.h" + +// Specification. +#include "cl_dfloat.h" + + +// Implementation. + +#include "cl_N.h" + +inline cl_boolean cl_DF_p (const cl_number& x) +{ + if (x.pointer_p()) + if (x.heappointer->type == &cl_class_dfloat) + return cl_true; + return cl_false; +} + +const cl_DF& as_cl_DF (const cl_number& x, const char * filename, int line) +{ + if (cl_DF_p(x)) { + DeclareType(cl_DF,x); + return x; + } else + cl_as_error(x,"a double-float number",filename,line); +}