9 #define REAL_LONG_DOUBLE 2
10 #define REAL_SINGLE_FAST2SUM 3 //TODO: Remove, is FITH
11 #define REAL_RATIONAL 4
14 #error "REAL was not defined!"
17 #if REAL >= REAL_SINGLE_FAST2SUM
18 #include "real_fast2sum.h"
21 #if REAL == REAL_RATIONAL
27 extern const char * g_real_name[];
29 #if REAL == REAL_SINGLE
31 #elif REAL == REAL_DOUBLE
33 #elif REAL == REAL_LONG_DOUBLE
34 typedef long double Real;
35 #elif REAL == REAL_SINGLE_FAST2SUM
36 typedef RealF2S<float> Real;
37 inline float Float(const Real & r) {return r.m_value;}
38 inline double Double(const Real & r) {return r.m_value;}
39 #elif REAL == REAL_RATIONAL
41 typedef Rational<int64_t> Real;
42 inline float Float(const Real & r) {return (float)r.ToDouble();}
43 inline double Double(const Real & r) {return r.ToDouble();}
45 #error "Type of Real unspecified."
48 // Allow us to call Float on the primative types
49 // Useful so I can template some things that could be either (a more complicated) Real or a primitive type
50 // Mostly in the testers.
51 inline float Float(float f) {return (float)f;}
52 inline float Float(double f) {return (float)f;}
53 inline float Float(long double f) {return (float)(f);}
54 inline double Double(float f) {return (double)f;}
55 inline double Double(double f) {return (double)f;}
56 inline double Double(long double f) {return (double)(f);}