Loïc Grenié on Thu, 21 Jan 2016 09:34:28 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Using localprec to add guard word(s)


On 2016-01-21 at 8:22 GMT+01:00 Charles Greathouse wrote:
I have what I imagine is a common use case for localprec(): I have a calculation which is likely to need additional precision so it can return a result at the current precision. My inclination was to write

foo()=localprec(default(realprecision)+9); ...

but I realized that default(realprecision) is really the wrong thing, as it could be higher or lower than the current precision, as indeed ??localprec states. Is there a good way to do this?

     I don't know whether there is a good way to do this, but there is a bad one:

localprec(precision(1.)+9);
 
           Loïc