diff --git a/src/utility/vector.h b/src/utility/vector.h index dd3bb2a1f..f8a56382a 100644 --- a/src/utility/vector.h +++ b/src/utility/vector.h @@ -330,6 +330,9 @@ namespace storm { template bool equalModuloPrecision(T const& val1, T const& val2, T precision, bool relativeError = true) { if (relativeError) { + if (val2 == 0) { + return (std::abs(val1) <= precision); + } if (std::abs(val1 - val2)/val2 > precision) return false; } else { if (std::abs(val1 - val2) > precision) return false;