diff options
author | Tim King <taking@cs.nyu.edu> | 2018-01-07 16:46:16 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-07 16:46:16 -0800 |
commit | 20957db27201d594a83e0e5abe77875ed4932faf (patch) | |
tree | 47c665493a2a26d9ad50d2f53de310a7ce8193e0 /src/util/rational_gmp_imp.h | |
parent | 8497910df4d1c254b26f09c3dc5ee6191c970b12 (diff) |
Removes RationalFromDoubleException. Replaces this with an explicit M… (#1476)
* Removes RationalFromDoubleException. Replaces this with an explicit Maybe<Rational> datatype. Makes Maybe<T> CVC4_PUBLIC. Updates the users of Rational::fromDouble(). Miscellaneous cleanup of ApproxSimplex.
Diffstat (limited to 'src/util/rational_gmp_imp.h')
-rw-r--r-- | src/util/rational_gmp_imp.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/util/rational_gmp_imp.h b/src/util/rational_gmp_imp.h index 70146561d..7c17ead15 100644 --- a/src/util/rational_gmp_imp.h +++ b/src/util/rational_gmp_imp.h @@ -32,14 +32,10 @@ #include "base/exception.h" #include "util/integer.h" +#include "util/maybe.h" namespace CVC4 { -class CVC4_PUBLIC RationalFromDoubleException : public Exception { -public: - RationalFromDoubleException(double d) throw(); -}; - /** ** A multi-precision rational constant. ** This stores the rational as a pair of multi-precision integers, @@ -192,7 +188,7 @@ public: return Integer(d_value.get_den()); } - static Rational fromDouble(double d) throw(RationalFromDoubleException); + static Maybe<Rational> fromDouble(double d); /** * Get a double representation of this Rational, which is |