diff --git a/src/storm/utility/constants.cpp b/src/storm/utility/constants.cpp index fdaa62a51..a5e1c14f5 100644 --- a/src/storm/utility/constants.cpp +++ b/src/storm/utility/constants.cpp @@ -258,7 +258,8 @@ namespace storm { template ValueType round(ValueType const& number) { - return std::round(number); + // Rounding towards infinity + return floor(number + storm::utility::convertNumber(0.5)); } template @@ -422,11 +423,6 @@ namespace storm { return carl::ceil(number); } - template<> - ClnRationalNumber round(storm::ClnRationalNumber const& number) { - return carl::round(number); - } - template<> ClnRationalNumber log(ClnRationalNumber const& number) { return carl::log(number); @@ -620,11 +616,6 @@ namespace storm { return carl::ceil(number); } - template<> - GmpRationalNumber round(storm::GmpRationalNumber const& number) { - return carl::round(number); - } - template<> GmpRationalNumber log(GmpRationalNumber const& number) { return carl::log(number); @@ -991,6 +982,7 @@ namespace storm { template storm::ClnRationalNumber maximum(std::vector const&); template storm::ClnRationalNumber max(storm::ClnRationalNumber const& first, storm::ClnRationalNumber const& second); template storm::ClnRationalNumber min(storm::ClnRationalNumber const& first, storm::ClnRationalNumber const& second); + template storm::ClnRationalNumber round(storm::ClnRationalNumber const& number); template std::string to_string(storm::ClnRationalNumber const& value); #endif @@ -1015,6 +1007,7 @@ namespace storm { template storm::GmpRationalNumber maximum(std::vector const&); template storm::GmpRationalNumber max(storm::GmpRationalNumber const& first, storm::GmpRationalNumber const& second); template storm::GmpRationalNumber min(storm::GmpRationalNumber const& first, storm::GmpRationalNumber const& second); + template storm::GmpRationalNumber round(storm::GmpRationalNumber const& number); template std::string to_string(storm::GmpRationalNumber const& value); #endif