carl  24.04
Computer ARithmetic Library
CArLConverter.h
Go to the documentation of this file.
1 /**
2  * @file CArLConverter.h
3  * @author Gereon Kremer <gereon.kremer@cs.rwth-aachen.de>
4  */
5 
6 #pragma once
7 
9 
10 namespace carl {
11 
13 public:
14 #ifdef USE_CLN_NUMBERS
15  mpq_class toGMP(const cln::cl_RA& n) {
16  std::stringstream ss1;
17  ss1 << carl::get_denom(n);
18  mpz_class denom(ss1.str());
19  std::stringstream ss2;
20  ss2 << carl::get_num(n);
21  mpz_class num(ss2.str());
22  return carl::quotient(num, denom);
23  }
24 #endif
25 };
26 
27 }
carl is the main namespace for the library.
Interval< Number > quotient(const Interval< Number > &_lhs, const Interval< Number > &_rhs)
Implements the division with remainder.
Definition: Interval.h:1488
cln::cl_I get_num(const cln::cl_RA &n)
Extract the numerator from a fraction.
Definition: operations.h:60
cln::cl_I get_denom(const cln::cl_RA &n)
Extract the denominator from a fraction.
Definition: operations.h:69