]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Avoid a compiler warning about a double passed as an integer. This can
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 3 Aug 2011 15:54:15 +0000 (15:54 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 3 Aug 2011 15:54:15 +0000 (15:54 +0000)
be avoided by using an integer power function.

git-svn-id: https://svn.dealii.org/trunk@24004 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/base/tensor.h

index 93795b10caa02a26389be07084564fd91e696e7d..96130fb72946a8f047ad99cfec80c4195dad764f 100644 (file)
@@ -519,9 +519,8 @@ inline
 void
 Tensor<rank_, dim, Number>::unroll (Vector<Number2> &result) const
 {
-  AssertDimension (result.size(),
-                  static_cast<unsigned int>(std::pow(static_cast<double>(dim),
-                                                     rank_)));
+  AssertDimension (result.size(),(Utilities::fixed_power<rank_, unsigned int>(dim)));
+
   unsigned index = 0;
   unroll_recursion (result, index);
 }

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.