11 template<
typename Rational>
13 using limits = std::numeric_limits<double>;
15 if (result == -limits::infinity()) {
18 if (result == limits::infinity()) {
22 if (overapproximate || carl::rationalize<Rational>(result) != o) {
23 if (result == -limits::max()) {
24 return -limits::infinity();
26 return std::nextafter(result, -limits::infinity());
37 template<
typename Rational>
39 using limits = std::numeric_limits<double>;
41 if (result == limits::infinity()) {
44 if (result == -limits::infinity()) {
45 return -limits::max();
48 if (overapproximate || carl::rationalize<Rational>(result) != o) {
49 if (result == limits::max()) {
50 return limits::infinity();
52 return std::nextafter(result, limits::infinity());
carl is the main namespace for the library.
double roundDown(const Rational &o, bool overapproximate=false)
Returns a down-rounded representation of the given numeric.
double roundUp(const Rational &o, bool overapproximate=false)
Returns a up-rounded representation of the given numeric.
double to_double(const cln::cl_RA &n)
Converts the given fraction to a double.