[petsc-dev] fortran literals

Jed Brown jed at jedbrown.org
Thu Sep 1 23:28:37 CDT 2016


Barry Smith <bsmith at mcs.anl.gov> writes:
>   Horrible to have to uglify all the source code for all real numbers without exact hexadecimal representation like this.
>
>    I could live with having 
>
>    PetscReal a = .7_Q; 
>
> say (which won't work) but asking me to accept PetscRealLiteral(0.7); doesn't make me happy.
>
>    PetscReal a = _R(.7)  as an unhappy compromise? With imperfect namespacing.

Oh, I figured the non-namespaced version would be used privately in
compilation units that make heavy use of it.  But #define'ing _R() in a
public header would be bad behavior even if it didn't violate the
standard.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 800 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20160901/61ddef99/attachment.sig>


More information about the petsc-dev mailing list