]> www.ginac.de Git - cln.git/blob - include/cln/float_class.h
Add support for x86_64 CPU.
[cln.git] / include / cln / float_class.h
1 // Abstract class of floating-point numbers.
2
3 #ifndef _CL_FLOAT_CLASS_H
4 #define _CL_FLOAT_CLASS_H
5
6 #include "cln/number.h"
7 #include "cln/real_class.h"
8
9 namespace cln {
10
11 class cl_F : public cl_R {
12 public:
13 // Default constructor.
14         cl_F ();
15 // Copy constructor.
16         cl_F (const cl_F&);
17 // Converters.
18 // Assignment operators.
19         cl_F& operator= (const cl_F&);
20 // Constructors and assignment operators from C numeric types.
21         cl_F (const float);
22         cl_F (const double);
23         cl_F& operator= (const float);
24         cl_F& operator= (const double);
25 // Other constructors.
26         cl_F (const char *);
27 // Private constructor.
28         cl_F (cl_private_thing);
29 public: // Ability to place an object at a given address.
30         void* operator new (size_t size) { return malloc_hook(size); }
31         void* operator new (size_t size, void* ptr) { (void)size; return ptr; }
32         void operator delete (void* ptr) { free_hook(ptr); }
33 private:
34 // Friend declarations. They are for the compiler. Just ignore them.
35 };
36
37 // Private constructors.
38 inline cl_F::cl_F (cl_private_thing ptr) : cl_R (ptr) {}
39 // The assignment operators:
40 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_F, cl_F)
41 // The default constructors.
42 inline cl_F::cl_F ()
43         : cl_R ((cl_private_thing) cl_combine(cl_SF_tag,0)) {}
44 // The copy constructors.
45 CL_DEFINE_COPY_CONSTRUCTOR2(cl_F,cl_R)
46 // Constructors and assignment operators from C numeric types.
47 CL_DEFINE_FLOAT_CONSTRUCTOR(cl_F)
48 CL_DEFINE_DOUBLE_CONSTRUCTOR(cl_F)
49
50 }  // namespace cln
51
52 #endif /* _CL_FLOAT_CLASS_H */