00001 #ifndef realroot_ARITHM_TRAITS_RATIONALOF_H
00002 #define realroot_ARITHM_TRAITS_RATIONALOF_H
00003 #include <realroot/texp_integerof.hpp>
00004
00005 namespace mmx {
00006
00007 namespace texp
00008 {
00009 template<class X> struct rationalof_ { typedef null_t T; };
00010
00011
00012 template<class K, class X, class extended> struct kernel_rationalof;
00013 template<class K, class X> struct kernel_rationalof<K,X,true_t> { typedef typename K::extended_rational T; };
00014 template<class K, class X> struct kernel_rationalof<K,X,false_t> { typedef typename K::rational T; };
00015 template<class X, class extended>
00016 struct kernel_rationalof<null_t,X,extended> { typedef typename rationalof_<X>::T T; };
00017 template<class X>
00018 struct rationalof
00019 {
00020 typedef typename ucstref<X>::T _X;
00021 typedef typename kernel_rationalof< typename kernelof<X>::T, _X, typename is_extended<X>::T >::T T;
00022 };
00023 };
00024
00025 }
00026
00027 #endif