]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Proper comparison of doubles.
authorRalf Hartmann <Ralf.Hartmann@dlr.de>
Mon, 24 May 2004 14:39:56 +0000 (14:39 +0000)
committerRalf Hartmann <Ralf.Hartmann@dlr.de>
Mon, 24 May 2004 14:39:56 +0000 (14:39 +0000)
git-svn-id: https://svn.dealii.org/trunk@9301 0785d39b-7218-0410-832d-ea1e28bc413d

tests/bits/petsc_18.cc

index 0175e192f6959fee3be38fe41622ffcb8e051c30..f2340c68bf6e841b7634b2eab05a10788427f394 100644 (file)
@@ -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;
 }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.