]> https://gitweb.dealii.org/ - dealii.git/commitdiff
MAC: maybe fix test 1096/head
authorTimo Heister <timo.heister@gmail.com>
Thu, 9 Jul 2015 14:31:47 +0000 (10:31 -0400)
committerTimo Heister <timo.heister@gmail.com>
Thu, 9 Jul 2015 14:31:47 +0000 (10:31 -0400)
Forcing all computations to be done as long double with the hope that
this fixes the numerical differences on the MAC tester.

tests/base/quadrature_chebyshev.cc

index 5314b558cf21b1627fd836d1a9f895f720efa077..28e6109be1cea3f2875cbc08d9c7ee703b99ed1f 100644 (file)
@@ -113,7 +113,7 @@ void check_quadrature(double *exact_monomials)
 
      for (unsigned int i=0; i<32; ++i)
      {
-       double quadrature_int=0;
+       long double quadrature_int=0;
        double err = 0;
 
        // Check the integral
@@ -121,8 +121,8 @@ void check_quadrature(double *exact_monomials)
        long double f=1.;
        for (unsigned int x=0; x<quadrature.size(); ++x)
        {
-            f = std::pow((long double) points[x](0), i*1.0L);
-            quadrature_int+=f*weights[x];
+        f = std::pow(static_cast<long double>(points[x](0)), i*1.0L);
+        quadrature_int+=f*static_cast<long double>(weights[x]);
        }
        err = std::fabs(quadrature_int-exact_monomials[i]);
        if (err < 1.e-15)

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.