From cd46a6b0c64a2fb3e7abaf10603c0fe20eb31cb8 Mon Sep 17 00:00:00 2001 From: PBerger Date: Sat, 15 Mar 2014 22:06:49 +0100 Subject: [PATCH] Fixed a bug in the equalModuloPrecision function. Former-commit-id: 465d90b4a7ad83cce9d0d18cbac3785946db18e7 --- src/utility/vector.h | 3 +++ 1 file changed, 3 insertions(+) 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;