Charles Greathouse on Thu, 21 Jan 2016 08:22:41 +0100

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

Using localprec to add guard word(s)

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?

Charles Greathouse
Case Western Reserve University