]> www.ginac.de Git - cln.git/blob - include/cl_lfloat_class.h
- Added lots of @cindex to produce an index.
[cln.git] / include / cl_lfloat_class.h
1 // Concrete class of long float numbers.
2
3 #ifndef _CL_LFLOAT_CLASS_H
4 #define _CL_LFLOAT_CLASS_H
5
6 #include "cl_number.h"
7 #include "cl_float_class.h"
8
9
10 class cl_LF : public cl_F {
11 public:
12 // Default constructor.
13         cl_LF ();
14 // Assignment operators.
15         cl_LF& operator= (const cl_LF&);
16 // Optimization of method pointer_p().
17         cl_boolean pointer_p() const
18                 { return cl_true; }
19 // Faster pointer_p() gives a faster copy constructor (but not destructor!!!).
20         cl_LF (const cl_LF& x);
21 // Other constructors.
22         cl_LF (const char *);
23 // Private constructor.
24         cl_LF (cl_private_thing);
25         cl_LF (struct cl_heap_lfloat *);
26 // Private pointer manipulations.
27         operator struct cl_heap_lfloat * () const;
28 public: // Ability to place an object at a given address.
29         void* operator new (size_t size) { return cl_malloc_hook(size); }
30         void* operator new (size_t size, cl_LF* ptr) { (void)size; return ptr; }
31         void operator delete (void* ptr) { cl_free_hook(ptr); }
32 };
33 // Define this if you want the elementary cl_LF operations (+, -, *, /,
34 // sqrt, cl_LF_I_mul) to return results which are always the correctly
35 // rounded exact results, i.e. results which are correct within 0.5 ulp.
36 // If you don't define this, results will be correct within 0.50001 ulp,
37 // but often the computation will be much faster.
38 /* #define CL_LF_PEDANTIC */
39
40 // Private constructors.
41 inline cl_LF::cl_LF (cl_private_thing ptr) : cl_F (ptr) {}
42 // The assignment operators:
43 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_LF, cl_LF)
44 // The default constructors.
45 // Private pointer manipulations. Never throw away a `struct cl_heap_lfloat *'!
46 inline cl_LF::operator struct cl_heap_lfloat * () const
47 {
48         struct cl_heap_lfloat * hpointer = (struct cl_heap_lfloat *) pointer;
49         cl_inc_refcount(*this);
50         return hpointer;
51 }
52 extern const cl_LF cl_LF_0;
53 inline cl_LF::cl_LF ()
54         : cl_F ((cl_private_thing) (struct cl_heap_lfloat *) cl_LF_0) {}
55 CL_REQUIRE(cl_LF_globals)
56 #if 0 // see cl_LF_impl.h
57 inline cl_LF::cl_LF (struct cl_heap_lfloat * ptr)
58         : cl_F ((cl_private_thing) ptr) {}
59 #endif
60 // The copy constructors.
61 CL_DEFINE_COPY_CONSTRUCTOR2(cl_LF,cl_F)
62
63
64 #endif /* _CL_LFLOAT_CLASS_H */