]> www.ginac.de Git - cln.git/blob - src/float/ffloat/misc/cl_FF_as.cc
Finalize CLN 1.3.7 release.
[cln.git] / src / float / ffloat / misc / cl_FF_as.cc
1 // cl_FF_As().
2
3 // General includes.
4 #include "base/cl_sysdep.h"
5
6 // Specification.
7 #include "cln/ffloat.h"
8
9
10 // Implementation.
11
12 #include "base/cl_N.h"
13
14 namespace cln {
15
16 inline bool cl_FF_p (const cl_number& x)
17 {
18 #if defined(CL_WIDE_POINTERS)
19         if (!x.pointer_p())
20                 if (cl_tag((x).word) == cl_FF_tag)
21                         return true;
22 #else
23         if (x.pointer_p())
24                 if (x.heappointer->type == &cl_class_ffloat)
25                         return true;
26 #endif
27         return false;
28 }
29
30 const cl_FF& cl_FF_As (const cl_number& x, const char * filename, int line)
31 {
32         if (cl_FF_p(x)) {
33                 DeclareType(cl_FF,x);
34                 return x;
35         } else
36                 throw as_exception(x,"a single-float number",filename,line);
37 }
38
39 }  // namespace cln