From: wolf Date: Wed, 26 Sep 2001 07:01:53 +0000 (+0000) Subject: Cast long doubles to doubles, since that is necessary with DEC's cxx compiler as... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=960003de121e20b7d8cf2bb1e3623f877d981154;p=dealii-svn.git Cast long doubles to doubles, since that is necessary with DEC's cxx compiler as that one overloads std::fabs for long doubles. git-svn-id: https://svn.dealii.org/trunk@5063 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-10/step-10.cc b/deal.II/examples/step-10/step-10.cc index 6070e89f61..5a03cabb6a 100644 --- a/deal.II/examples/step-10/step-10.cc +++ b/deal.II/examples/step-10/step-10.cc @@ -475,9 +475,20 @@ void compute_pi_by_area () // cast to double as there // is no add_value(string, // long double) function - // implemented. + // implemented. Note that + // this also concerns the + // second call as the ``fabs'' + // function in the ``std'' + // namespace is overloaded on + // its argument types, so there + // exists a version taking + // and returning a ``long double'', + // in contrast to the global + // namespace where only one such + // function is declared (which + // takes and returns a double). table.add_value("eval.pi", static_cast (area)); - table.add_value("error", std::fabs(area-pi)); + table.add_value("error", static_cast (std::fabs(area-pi))); }; // We want to compute @@ -594,7 +605,7 @@ void compute_pi_by_perimeter () // Then store the evaluated // values in the table... table.add_value("eval.pi", static_cast (perimeter/2.)); - table.add_value("error", std::fabs(perimeter/2.-pi)); + table.add_value("error", static_cast (std::fabs(perimeter/2.-pi))); }; // ...and end this function as