[petsc-dev] Ugly feature of __float128

Jed Brown jed at jedbrown.org
Wed Oct 28 23:38:54 CDT 2015


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20151028/7dfb7b07/attachment.sig>


More information about the petsc-dev mailing list