]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Use long double for intermediate quadrature result in order to reduce the roundoff...
authorleicht <leicht@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 30 May 2007 05:00:46 +0000 (05:00 +0000)
committerleicht <leicht@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 30 May 2007 05:00:46 +0000 (05:00 +0000)
git-svn-id: https://svn.dealii.org/trunk@14731 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/quadrature_test.cc

index 5c86d85301097561d5e3decbd1839580fade2b90..4a4e59f8ac7e7dd5ab5fbd1cfe700f04087e05bb 100644 (file)
@@ -133,7 +133,7 @@ check_faces (const std::vector<Quadrature<dim-1>*>& quadratures, const bool sub)
       deallog << "Quadrature no." << n;
 
       unsigned int i=0;
-      double quadrature_int=0;
+      long double quadrature_int=0;
       double exact_int=0;
       double err = 0;
 
@@ -147,15 +147,15 @@ check_faces (const std::vector<Quadrature<dim-1>*>& quadratures, const bool sub)
 
          for (unsigned int x=0; x<quadrature.n_quadrature_points; ++x)
            {
-             double f=1.;
+             long double f=1.;
              switch (dim)
                {
                case 3:
-                 f *= std::pow(points[x](2), i*1.0);
+                 f *= std::pow((long double) points[x](2), i*1.0L);
                case 2:
-                 f *= std::pow(points[x](1), i*1.0);
+                 f *= std::pow((long double) points[x](1), i*1.0L);
                case 1:
-                 f *= std::pow(points[x](0), i*1.0);
+                 f *= std::pow((long double) points[x](0), i*1.0L);
                }
              quadrature_int+=f*weights[x];
            }

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.