realroot_doc 0.1.1
|
00001 #ifndef realroot_ARITHM_TRAITS_ISEXACT_H 00002 #define realroot_ARITHM_TRAITS_ISEXACT_H 00003 00004 #include <realroot/texp_kernelof.hpp> 00005 00006 namespace mmx { 00007 00008 namespace texp { 00009 00010 template<class X> struct isexact_ { typedef false_t T; }; 00011 00012 template<class K, class X> struct kernel_isexact { typedef true_t T; }; 00013 template<class X> struct kernel_isexact<null_t,X> { typedef typename isexact_<X>::T T; }; 00014 00015 template<class K> struct kernel_isexact< K, typename K::integer > { typedef true_t T; }; 00016 template<class K> struct kernel_isexact< K, typename K::rational > { typedef true_t T; }; 00017 template<class K> struct kernel_isexact< K, typename K::floating > { typedef false_t T; }; 00018 template<class K> struct kernel_isexact< K, typename K::ieee > { typedef false_t T; }; 00019 00028 template<typename X> 00029 struct isexact 00030 { 00031 typedef typename ucstref<X>::T _X; 00032 typedef typename kernel_isexact< typename kernelof<X>::T, _X >::T T; 00033 }; 00034 00036 template<typename X> 00037 struct isapproximate { typedef typename tnot< typename isexact< X >::T >::T T; }; 00038 00039 } 00040 00041 } //namespace mmx 00042 00043 #endif 00044 00045