Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Concrete class of long float numbers.
0002 
0003 #ifndef _CL_LFLOAT_CLASS_H
0004 #define _CL_LFLOAT_CLASS_H
0005 
0006 #include "cln/number.h"
0007 #include "cln/float_class.h"
0008 
0009 namespace cln {
0010 
0011 class cl_LF : public cl_F {
0012 public:
0013 // Default constructor.
0014     cl_LF ();
0015 // Assignment operators.
0016     cl_LF& operator= (const cl_LF&);
0017 // Optimization of method pointer_p().
0018     bool pointer_p() const
0019         { return true; }
0020 // Faster pointer_p() gives a faster copy constructor (but not destructor!!!).
0021     cl_LF (const cl_LF& x);
0022 // Other constructors.
0023     cl_LF (const char *);
0024 // Private constructor.
0025     cl_LF (cl_private_thing);
0026     cl_LF (struct cl_heap_lfloat *);
0027 // Private pointer manipulations.
0028     operator struct cl_heap_lfloat * () const;
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 };
0034 // Define this if you want the elementary cl_LF operations (+, -, *, /,
0035 // sqrt, cl_LF_I_mul) to return results which are always the correctly
0036 // rounded exact results, i.e. results which are correct within 0.5 ulp.
0037 // If you don't define this, results will be correct within 0.50001 ulp,
0038 // but often the computation will be much faster.
0039 /* #define CL_LF_PEDANTIC */
0040 
0041 // Private constructors.
0042 inline cl_LF::cl_LF (cl_private_thing ptr) : cl_F (ptr) {}
0043 // The assignment operators:
0044 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_LF, cl_LF)
0045 // The default constructors.
0046 // Private pointer manipulations. Never throw away a `struct cl_heap_lfloat *'!
0047 inline cl_LF::operator struct cl_heap_lfloat * () const
0048 {
0049     struct cl_heap_lfloat * hpointer = (struct cl_heap_lfloat *) pointer;
0050     cl_inc_refcount(*this);
0051     return hpointer;
0052 }
0053 extern const cl_LF cl_LF_0;
0054 inline cl_LF::cl_LF ()
0055     : cl_F ((cl_private_thing) (struct cl_heap_lfloat *) cl_LF_0) {}
0056 class cl_LF_globals_init_helper
0057 {
0058     static int count;
0059 public:
0060     cl_LF_globals_init_helper();
0061     ~cl_LF_globals_init_helper();
0062 };
0063 static cl_LF_globals_init_helper cl_LF_globals_init_helper_instance;
0064 #if 0 // see cl_LF_impl.h
0065 inline cl_LF::cl_LF (struct cl_heap_lfloat * ptr)
0066     : cl_F ((cl_private_thing) ptr) {}
0067 #endif
0068 // The copy constructors.
0069 CL_DEFINE_COPY_CONSTRUCTOR2(cl_LF,cl_F)
0070 
0071 }  // namespace cln
0072 
0073 #endif /* _CL_LFLOAT_CLASS_H */