|
@ -330,6 +330,9 @@ namespace storm { |
|
|
template<class T> |
|
|
template<class T> |
|
|
bool equalModuloPrecision(T const& val1, T const& val2, T precision, bool relativeError = true) { |
|
|
bool equalModuloPrecision(T const& val1, T const& val2, T precision, bool relativeError = true) { |
|
|
if (relativeError) { |
|
|
if (relativeError) { |
|
|
|
|
|
if (val2 == 0) { |
|
|
|
|
|
return (std::abs(val1) <= precision); |
|
|
|
|
|
} |
|
|
if (std::abs(val1 - val2)/val2 > precision) return false; |
|
|
if (std::abs(val1 - val2)/val2 > precision) return false; |
|
|
} else { |
|
|
} else { |
|
|
if (std::abs(val1 - val2) > precision) return false; |
|
|
if (std::abs(val1 - val2) > precision) return false; |
|
|