|
From: Luigi B. <lui...@gm...> - 2008-08-04 14:03:45
|
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. |