[Dune-devel] [Dune-Commit] [Commit] dune-geometry - cb66db8: Add explicit conversion, needed when using high precision types like boost::multiprecision

Markus Blatt markus at dr-blatt.de
Thu Jun 12 19:08:21 CEST 2014


Hi,

On Wed, Jun 11, 2014 at 02:14:22PM +0200, Christian Engwer wrote:
> 
> commit cb66db83c5f74dd12368a2a841411f7b5787ffed
> Author:     Andreas Buhr <andreas at andreasbuhr.de>
> AuthorDate: Tue Jun 10 21:24:03 2014 +0200
> Commit:     Christian Engwer <christi at dune-project.org>
> CommitDate: Wed Jun 11 14:13:59 2014 +0200
> 
>     Add explicit conversion, needed when using high precision types like boost::multiprecision
> 
>  dune/geometry/multilineargeometry.hh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 
> 
> diff --git a/dune/geometry/multilineargeometry.hh b/dune/geometry/multilineargeometry.hh
> index 5b97272..ea6162d 100644
> --- a/dune/geometry/multilineargeometry.hh
> +++ b/dune/geometry/multilineargeometry.hh
> @@ -734,7 +734,7 @@ namespace Dune
>         */
>  
>        /* The second case effectively results in x* = 0 */
> -      ctype dfcxn = (cxn > Traits::tolerance() || cxn < -Traits::tolerance()) ? df / cxn : 0;
> +      ctype dfcxn = (cxn > Traits::tolerance() || cxn < -Traits::tolerance()) ? ctype(df / cxn) : ctype(0);
>  

Sorry for being dense, but I do not get why this is needed and hope to
learn something.

Aren't df and cxn of type ctype, anyway? Shouldn't the result then have the
correct type. Or is the problem assigning 0 to dfcxn?

Markus
-- 
Do you need more support with DUNE or HPC in general? 

Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de
Hans-Bunte-Str. 8-10, 69123 Heidelberg, Germany
Tel.: +49 (0) 160 97590858
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20140612/4a290cb1/attachment.sig>


More information about the Dune-devel mailing list