Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Abstract class of floating-point numbers.
0002 
0003 #ifndef _CL_FLOAT_CLASS_H
0004 #define _CL_FLOAT_CLASS_H
0005 
0006 #include "cln/number.h"
0007 #include "cln/real_class.h"
0008 
0009 namespace cln {
0010 
0011 class cl_F : public cl_R {
0012 public:
0013 // Default constructor.
0014     cl_F ();
0015 // Copy constructor.
0016     cl_F (const cl_F&);
0017 // Converters.
0018 // Assignment operators.
0019     cl_F& operator= (const cl_F&);
0020 // Constructors and assignment operators from C numeric types.
0021     cl_F (const float);
0022     cl_F (const double);
0023     cl_F& operator= (const float);
0024     cl_F& operator= (const double);
0025 // Other constructors.
0026     cl_F (const char *);
0027 // Private constructor.
0028     cl_F (cl_private_thing);
0029 public: // Ability to place an object at a given address.
0030     void* operator new (size_t size) { return malloc_hook(size); }
0031     void* operator new (size_t size, void* ptr) { (void)size; return ptr; }
0032     void operator delete (void* ptr) { free_hook(ptr); }
0033 private:
0034 // Friend declarations. They are for the compiler. Just ignore them.
0035 };
0036 
0037 // Private constructors.
0038 inline cl_F::cl_F (cl_private_thing ptr) : cl_R (ptr) {}
0039 // The assignment operators:
0040 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_F, cl_F)
0041 // The default constructors.
0042 inline cl_F::cl_F ()
0043     : cl_R ((cl_private_thing) cl_combine(cl_SF_tag,0)) {}
0044 // The copy constructors.
0045 CL_DEFINE_COPY_CONSTRUCTOR2(cl_F,cl_R)
0046 // Constructors and assignment operators from C numeric types.
0047 CL_DEFINE_FLOAT_CONSTRUCTOR(cl_F)
0048 CL_DEFINE_DOUBLE_CONSTRUCTOR(cl_F)
0049 
0050 }  // namespace cln
0051 
0052 #endif /* _CL_FLOAT_CLASS_H */