Re: [Quantlib-dev] std::power fails ..

Posted by Andreas Spengler-2 on
URL: http://quantlib.414.s1.nabble.com/std-power-fails-tp8104p8108.html

Hi,

Es schrieb Deepak

> I'm computing zero rates for a benchmark in QuantLib, but yesterday I
> encountered an error, I did debug the library and found std::power
> (-124.75591365063, 0.04928131417), returns #NUM ( Not a valid number)

First off, you probably mean "std::pow", right?

Have a look at http://www.cplusplus.com/reference/clibrary/cmath/pow/

There it says: "If base is negative and exponent is not an integral value,
or if base is zero and exponent is negative, a domain error occurs...

> I want to know, how to handle this kind of errors, it doesn't throw any
> exceptions.

...setting the global variable errno to the value EDOM."

Rgds,

Andreas


------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users