]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Avoid compile problem with std::pow by static_cast of the exponent to int.
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 19 Nov 2009 01:08:24 +0000 (01:08 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 19 Nov 2009 01:08:24 +0000 (01:08 +0000)
git-svn-id: https://svn.dealii.org/trunk@20132 0785d39b-7218-0410-832d-ea1e28bc413d

tests/codim_one/integrate_log.cc

index cda8c76de345da17acf7b0efe88ef46445865905..e9a08a341a641765ec868b14975a38bd1ff69c5a 100644 (file)
@@ -156,11 +156,11 @@ int main()
     for (unsigned int k=0; k<=j; k++)
        exact_integral +=
            newton_binomial(j,k)
-           *pow(a,j-k)
+           *pow(a,static_cast<int>(j-k))
            *(
-               pow(b-a,k+1) / (k+1) * log(b-a)
+             pow(b-a,static_cast<int>(k)+1) / (k+1) * log(b-a)
                -
-               pow(b-a,k+1) / pow(k+1, 2)
+             pow(b-a,static_cast<int>(k)+1) / pow(k+1, 2)
             ); 
     deallog << "f(x) = x^" << j << std::endl;
     for (unsigned int i=1; i<13; ++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.