]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
If there is no <limits> header, use old value for tolerance
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 20 Sep 2003 23:02:01 +0000 (23:02 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 20 Sep 2003 23:02:01 +0000 (23:02 +0000)
git-svn-id: https://svn.dealii.org/trunk@8001 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/source/quadrature_lib.cc

index f4709f74b42eae57a0b286f9fd221db71b470e4b..37b8c057fb86819ae0f62a1cf52356fb33eab66e 100644 (file)
 
 #include <base/quadrature_lib.h>
 #include <cmath>
-#include <limits>
+
+#ifdef HAVE_STD_NUMERIC_LIMITS
+#  include <limits>
+#endif
 
 
 // please note: for a given dimension, we need the quadrature formulae
@@ -46,9 +49,21 @@ QGauss<1>::QGauss (const unsigned int n)
                                    // of the accuracy of double there,
                                    // while on other machines we'd
                                    // like to go further down
+#ifdef HAVE_STD_NUMERIC_LIMITS    
   const long double tolerance
     = std::max (static_cast<long double>(std::numeric_limits<double>::epsilon() / 100),
                 static_cast<long double>(std::numeric_limits<long double>::epsilon() * 5));
+#else
+                                  // well, if there is no <limits>
+                                  // header, then we can do not much
+                                  // better than just checking by
+                                  // hand that long double is not the
+                                  // same as double and set some
+                                  // values by hand
+  const long double tolerance
+    = (sizeof(long double) != sizeof(double) ? 1.e-19 : 5e-16);
+#endif
+
   
   for (unsigned int i=1; i<=m; ++i)
     {

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.