[petsc-dev] Ugly feature of __float128
Jeff Hammond
jeff.science at gmail.com
Thu Oct 29 00:01:17 CDT 2015
Barry:
If you would only rewrite PETSc in a numerically oriented programming
language like Fortran, this problem would disappear.
See real(kind=REAL128) in ISO_FORTRAN_ENV, which is part of Fortran 2008.
Of course I am trolling, although I intend to use Fortran 2008 as my way of
getting 128b floats into MPI-4, which Jed has been asking for for a while
now.
Best,
Jeff
On Wed, Oct 28, 2015 at 9:38 PM, Jed Brown <jed at jedbrown.org> wrote:
> Barry Smith <bsmith at mcs.anl.gov> writes:
>
> > After wasting hours debugging I just realized that gcc __float128
> > REQUIRES that numerical constants be written with a q suffix or
> > first they are treated as double and then converted to __float.
>
> Unsuffixed numeric literals are double. It's the semantic of the
> language, not something they can change by adding a type. Sorry.
>
> > I cannot understand why this is done this way. Who wants to convert a
> code to __float128 and have to then label all floating point numbers with a
> q which of course also means the code is not compilable with other
> compilers in double.
>
> It's ugly, but you can put it in a macro:
>
> #define NUM(a) a ## q
>
--
Jeff Hammond
jeff.science at gmail.com
http://jeffhammond.github.io/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20151028/efdb25d3/attachment.html>
More information about the petsc-dev
mailing list