]> www.ginac.de Git - cln.git/blob - include/cl_real_class.h
Make @exec_prefix@ usable in shell scripts.
[cln.git] / include / cl_real_class.h
1 // Abstract class of real numbers.
2
3 #ifndef _CL_REAL_CLASS_H
4 #define _CL_REAL_CLASS_H
5
6 #include "cl_number.h"
7 #include "cl_complex_class.h"
8
9
10 class cl_R : public cl_N {
11 public:
12 // Default constructor.
13         cl_R ();
14 // Copy constructor.
15         cl_R (const cl_R&);
16 // Converters.
17 // Assignment operators.
18         cl_R& operator= (const cl_R&);
19 // Constructors and assignment operators from C numeric types.
20         cl_R (const int);               // |argument| must be < 2^29
21         cl_R (const unsigned int);      // argument must be < 2^29
22         cl_R (const long);
23         cl_R (const unsigned long);
24         cl_R (const float);
25         cl_R (const double);
26         cl_R& operator= (const int);            // |argument| must be < 2^29
27         cl_R& operator= (const unsigned int);   // argument must be < 2^29
28         cl_R& operator= (const long);
29         cl_R& operator= (const unsigned long);
30         cl_R& operator= (const float);
31         cl_R& operator= (const double);
32 // Other constructors.
33         cl_R (const char *);
34 // Private constructor.
35         cl_R (cl_private_thing);
36 public: // Ability to place an object at a given address.
37         void* operator new (size_t size) { return cl_malloc_hook(size); }
38         void* operator new (size_t size, cl_R* ptr) { (void)size; return ptr; }
39         void operator delete (void* ptr) { cl_free_hook(ptr); }
40 private:
41 // Friend declarations. They are for the compiler. Just ignore them.
42 };
43
44 // Private constructors.
45 inline cl_R::cl_R (cl_private_thing ptr) : cl_N (ptr) {}
46 // The assignment operators:
47 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_R, cl_R)
48 // The default constructors.
49 inline cl_R::cl_R ()
50         : cl_N ((cl_private_thing) cl_combine(cl_FN_tag,0)) {}
51 // The copy constructors.
52 CL_DEFINE_COPY_CONSTRUCTOR2(cl_R,cl_N)
53 // Constructors and assignment operators from C numeric types.
54 CL_DEFINE_INT_CONSTRUCTORS(cl_R)
55 CL_DEFINE_INT_ASSIGNMENT_OPERATORS(cl_R)
56 CL_DEFINE_LONG_CONSTRUCTORS(cl_R)
57 CL_DEFINE_LONG_ASSIGNMENT_OPERATORS(cl_R)
58 CL_DEFINE_FLOAT_CONSTRUCTOR(cl_R)
59 CL_DEFINE_DOUBLE_CONSTRUCTOR(cl_R)
60
61
62
63 #endif /* _CL_REAL_CLASS_H */