![]() |
![]() |
default definition is double More...
#include <PreciseFloatType.h>
Public Types | |
typedef double | Type |
default definition is double
Defines a typeded corresponding to the more precise of the two floating point types. This is useful for mixed precision arithmetic, e.g. to determin the return type. Example of use: template <class T, class U> typename PreciseFloatType<T,U>::Type operator+( const Vector<T>& a, const Vector<U>& b) { typename PreciseFloatType<T,U>::Type result(a); // assuming constructability return a+=b; // and addition for Vector of different type. }
This implementation is very simple, it only handles float, double and long double. for all other types PreciseFloatType<T,U>::Type is double if not compared to long double, otherwise it is long double.
Definition at line 23 of file PreciseFloatType.h.
typedef double PreciseFloatType< T, U >::Type |
Definition at line 25 of file PreciseFloatType.h.