Re: precision in cubicsplineinterpolation (and in general)

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/precision-in-cubicsplineinterpolation-and-in-general-tp12216p12219.html

On Wed, 2008-07-23 at 15:53 -0400, Sylvain Bertrand wrote:
> Anyway, I tried to change the QL_REAL from double to long double (it
> might actually partially solve my issue).
>  
> But then I faced errors calling std::max with a long double on one
> side, and 0. on the other side. As everyone knows, 0. is a double, and
> max can only be called with two args of the same type. I would need
> 0.L here.

Yes, or we might specify std::max<Real>(x, 0) so that the 0 gets
converted to the right type.

> I'm quite confident on the fact that less than 0.1% of users have ever
> thought of changing QL_REAL, but what if? Is QuantLib supposed to
> support other types of Real?

We used the QL_REAL thing so that, in case one wanted to try and change
the default float type, we didn't have double hard-coded everywhere. But
we never tried very hard to make the library even compile with different
types.

As for your spline calculations, if you need long doubles, just go ahead
and use long double.

Luigi



--

Weiler's Law:
Nothing is impossible for the man who doesn't have to
do it himself.



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev