> On Sep 1, 2016, at 10:29 PM, Jed Brown <[email protected]> wrote:
> 
> "Munson, Todd" <[email protected]> writes:
>> Any idea how to do the same thing in C?
> 
> #define PetscRealLiteral(x) (x ## q)
> 
> PetscReal a = PetscRealLiteral(0.7);

  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.
 

>  
> 
> Seems like we should do that for the precomputed methods in TS.
> Actually, it would be better to do all the setup arithmetic in the most
> accurate supported type.  Unfortunately, those methods are often
> computed using tools that only support double precision or are taken
> From papers that only report that many digits.

Reply via email to