Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-19 08:08:32

0001 // Abstract class of rational numbers.
0002 
0003 #ifndef _CL_RATIONAL_CLASS_H
0004 #define _CL_RATIONAL_CLASS_H
0005 
0006 #include "cln/number.h"
0007 #include "cln/real_class.h"
0008 
0009 namespace cln {
0010 
0011 class cl_RA : public cl_R {
0012 public:
0013 // Default constructor.
0014     cl_RA ();
0015 // Copy constructor.
0016     cl_RA (const cl_RA&);
0017 // Converters.
0018 // Assignment operators.
0019     cl_RA& operator= (const cl_RA&);
0020 // Constructors and assignment operators from C numeric types.
0021     cl_RA (const int);      // |argument| must be < 2^29
0022     cl_RA (const unsigned int); // argument must be < 2^29
0023     cl_RA (const long);
0024     cl_RA (const unsigned long);
0025     cl_RA (const long long);
0026     cl_RA (const unsigned long long);
0027     cl_RA& operator= (const int);       // |argument| must be < 2^29
0028     cl_RA& operator= (const unsigned int);  // argument must be < 2^29
0029     cl_RA& operator= (const long);
0030     cl_RA& operator= (const unsigned long);
0031     cl_RA& operator= (const long long);
0032     cl_RA& operator= (const unsigned long long);
0033 // Other constructors.
0034     cl_RA (const char *);
0035 // Private constructor.
0036     cl_RA (cl_private_thing);
0037     cl_RA (struct cl_heap_ratio *);
0038 public: // Ability to place an object at a given address.
0039     void* operator new (size_t size) { return malloc_hook(size); }
0040     void* operator new (size_t size, void* ptr) { (void)size; return ptr; }
0041     void operator delete (void* ptr) { free_hook(ptr); }
0042 private:
0043 // Friend declarations. They are for the compiler. Just ignore them.
0044 };
0045 
0046 // Private constructors.
0047 inline cl_RA::cl_RA (cl_private_thing ptr) : cl_R (ptr) {}
0048 // The assignment operators:
0049 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_RA, cl_RA)
0050 // The default constructors.
0051 inline cl_RA::cl_RA ()
0052     : cl_R ((cl_private_thing) cl_combine(cl_FN_tag,0)) {}
0053 // The copy constructors.
0054 CL_DEFINE_COPY_CONSTRUCTOR2(cl_RA,cl_R)
0055 // Constructors and assignment operators from C numeric types.
0056 CL_DEFINE_INT_CONSTRUCTORS(cl_RA)
0057 CL_DEFINE_INT_ASSIGNMENT_OPERATORS(cl_RA)
0058 CL_DEFINE_LONG_CONSTRUCTORS(cl_RA)
0059 CL_DEFINE_LONG_ASSIGNMENT_OPERATORS(cl_RA)
0060 CL_DEFINE_LONGLONG_CONSTRUCTORS(cl_RA)
0061 CL_DEFINE_LONGLONG_ASSIGNMENT_OPERATORS(cl_RA)
0062 
0063 }  // namespace cln
0064 
0065 #endif /* _CL_RATIONAL_CLASS_H */