]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make it compile also for PetscScalar=float.
authorRalf Hartmann <Ralf.Hartmann@dlr.de>
Mon, 7 Nov 2005 11:56:30 +0000 (11:56 +0000)
committerRalf Hartmann <Ralf.Hartmann@dlr.de>
Mon, 7 Nov 2005 11:56:30 +0000 (11:56 +0000)
git-svn-id: https://svn.dealii.org/trunk@11724 0785d39b-7218-0410-832d-ea1e28bc413d

tests/bits/petsc_33.cc

index 07cb7080b16feb6a3788e724b491c74e4e11bbd9..c42fef1bf171f44abaa3ff3ff71f544201afd6e0 100644 (file)
@@ -34,8 +34,8 @@ void test (PETScWrappers::Vector &v)
 
                                    // then check the norm
   const double eps=typeid(PetscScalar)==typeid(double) ? 1e-14 : 1e-5;
-  Assert (std::fabs(v.lp_norm(3) - std::pow(sum, 1./3.)) <
-          eps*std::pow(sum, 1./3.),
+  const double true_value=std::pow(sum, static_cast<PetscScalar> (1./3.));
+  Assert (std::fabs(v.lp_norm(3) - true_value) < eps*true_value,
           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.