From 4e1855a44020236aa7909efbca89d92aff11ad11 Mon Sep 17 00:00:00 2001 From: dehnert Date: Mon, 10 Apr 2017 09:22:59 +0200 Subject: [PATCH] use of intermediate value to make conversion work with gmp --- src/storm/utility/constants.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/storm/utility/constants.cpp b/src/storm/utility/constants.cpp index 6664c13d7..2c5210cbe 100644 --- a/src/storm/utility/constants.cpp +++ b/src/storm/utility/constants.cpp @@ -518,7 +518,7 @@ namespace storm { } template<> - RationalFunction convertNumber(int_fast64_t const& number){ + RationalFunction convertNumber(int_fast64_t const& number) { STORM_LOG_ASSERT(static_cast(number) == number, "Rationalizing failed, because the number is too large."); return RationalFunction(carl::rationalize(static_cast(number))); } @@ -530,11 +530,12 @@ namespace storm { } template<> - ClnRationalNumber convertNumber(RationalFunction const& number){ - return convertNumber(number.nominatorAsNumber() / number.denominatorAsNumber()); + ClnRationalNumber convertNumber(RationalFunction const& number) { + storm::RationalFunctionCoefficient tmp = number.nominatorAsNumber() / number.denominatorAsNumber(); + return convertNumber(tmp); } #endif - + #if defined(STORM_HAVE_GMP) template<> RationalFunction convertNumber(GmpRationalNumber const& number) {