15 inline FLOAT_T<mpq_class> convert<double, FLOAT_T<mpq_class>>(
const double& n) {
25 inline FLOAT_T<double> convert<mpq_class, FLOAT_T<double>>(
const mpq_class& n) {
40 inline FLOAT_T<mpq_class> convert<mpq_class, FLOAT_T<mpq_class>>(
const mpq_class& n) {
41 return FLOAT_T<mpq_class>(n);
50 inline FLOAT_T<double> convert<double, FLOAT_T<double>>(
const double& n) {
51 return FLOAT_T<double>(n);
56 inline double convert<FLOAT_T<mpfr_t>,
double>(
const FLOAT_T<mpfr_t>& n) {
61 inline FLOAT_T<mpfr_t> convert<double, FLOAT_T<mpfr_t>>(
const double& n) {
62 return FLOAT_T<mpfr_t>(n);
66 #ifdef USE_CLN_NUMBERS
68 inline double convert<cln::cl_RA, double>(
const cln::cl_RA& n) {
73 inline cln::cl_RA convert<double, cln::cl_RA>(
const double& n) {
74 return carl::rationalize<cln::cl_RA>(n);
78 inline double convert<FLOAT_T<cln::cl_RA>,
double>(
const FLOAT_T<cln::cl_RA>& n) {
83 inline FLOAT_T<cln::cl_RA> convert<double, FLOAT_T<cln::cl_RA>>(
const double& n) {
84 return FLOAT_T<cln::cl_RA>(n);
88 inline cln::cl_RA convert<FLOAT_T<cln::cl_RA>, cln::cl_RA>(
const FLOAT_T<cln::cl_RA>& n) {
93 inline FLOAT_T<cln::cl_RA> convert<cln::cl_RA, FLOAT_T<cln::cl_RA>>(
const cln::cl_RA& n) {
94 return FLOAT_T<cln::cl_RA>(n);
98 inline mpq_class convert<FLOAT_T<cln::cl_RA>, mpq_class>(
const FLOAT_T<cln::cl_RA>& n) {
99 return convert<cln::cl_RA,mpq_class>(n.value());
103 inline FLOAT_T<cln::cl_RA> convert<mpq_class, FLOAT_T<cln::cl_RA>>(
const mpq_class& n) {
104 return FLOAT_T<cln::cl_RA>(convert<mpq_class,cln::cl_RA>(n));
108 inline cln::cl_RA convert<FLOAT_T<mpq_class>, cln::cl_RA>(
const FLOAT_T<mpq_class>& n) {
109 return convert<mpq_class,cln::cl_RA>(n.value());
113 inline FLOAT_T<mpq_class> convert<cln::cl_RA, FLOAT_T<mpq_class>>(
const cln::cl_RA& n) {
114 return FLOAT_T<mpq_class>(convert<cln::cl_RA, mpq_class>(n));
carl is the main namespace for the library.
mpq_class rationalize< mpq_class >(float n)
mpq_class convert< double, mpq_class >(const double &n)
double to_double(const cln::cl_RA &n)
Converts the given fraction to a double.
double convert< mpq_class, double >(const mpq_class &n)
Templated wrapper class which allows universal usage of different IEEE 754 implementations.