From c29e5849d8e0b22cbfb840459c9976b3877a24ea Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Sun, 5 Nov 2017 18:33:40 +0100 Subject: [PATCH] Filter away small numbers to avoid roundoff errors for floats. --- tests/full_matrix/full_matrix_09.cc | 5 +++-- tests/full_matrix/full_matrix_10.cc | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/full_matrix/full_matrix_09.cc b/tests/full_matrix/full_matrix_09.cc index eff8fb1b12..77ececa4f1 100644 --- a/tests/full_matrix/full_matrix_09.cc +++ b/tests/full_matrix/full_matrix_09.cc @@ -41,7 +41,8 @@ void test() C.add(-1., E); - deallog << "Difference 1: " << (double)C.l1_norm() << std::endl; + const double tolerance = 100*std::numeric_limits::epsilon(); + deallog << "Difference 1: " << filter_out_small_numbers(C.l1_norm(),tolerance) << std::endl; C = 0; for (unsigned int i=0; i::epsilon()*50.) << std::endl; } int main() -- 2.39.5