From: hartmann Date: Mon, 24 May 2004 14:39:56 +0000 (+0000) Subject: Proper comparison of doubles. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db22ad74156d04d17f727bc6bfd42fb35f48b9c4;p=dealii-svn.git Proper comparison of doubles. git-svn-id: https://svn.dealii.org/trunk@9301 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/bits/petsc_18.cc b/tests/bits/petsc_18.cc index 0175e192f6..f2340c68bf 100644 --- a/tests/bits/petsc_18.cc +++ b/tests/bits/petsc_18.cc @@ -32,8 +32,8 @@ void test (PETScWrappers::Vector &v) } v.compress (); - // then check the norm - Assert (v.l2_norm() == std::sqrt(norm), ExcInternalError()); + // then check the norm + Assert (fabs(v.l2_norm()-std::sqrt(norm))<1e-14, ExcInternalError()); deallog << "OK" << std::endl; }