From fd8c05da2bc53b88ba2385ccee2bae6d318f1b12 Mon Sep 17 00:00:00 2001 From: wolf Date: Wed, 26 Sep 2001 06:59:10 +0000 Subject: [PATCH] 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/branches/Branch-3-2@5062 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-10/step-10.cc | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) 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 -- 2.39.5