]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove implicit cast from SymmetricTensor
authorJean-Paul Pelteret <jppelteret@gmail.com>
Thu, 2 Apr 2020 12:13:30 +0000 (14:13 +0200)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Mon, 4 May 2020 12:45:21 +0000 (14:45 +0200)
include/deal.II/base/symmetric_tensor.h

index 6fb2799a5428341d5b739b43d7f1154fd2c328ef..8788b60bad152bcefeb26306e8c79e802c40ec3a 100644 (file)
@@ -3523,7 +3523,8 @@ DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number>
   SymmetricTensor<2, dim, Number> result;
   for (unsigned int d = 0; d < dim; ++d)
     result[d][d] = t[d][d];
-  Number half = 0.5;
+
+  const Number half = internal::NumberType<Number>::value(0.5);
   for (unsigned int d = 0; d < dim; ++d)
     for (unsigned int e = d + 1; e < dim; ++e)
       result[d][e] = (t[d][e] + t[e][d]) * half;

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.