Hello! This short program #include <iostream> #include <ginac/ginac.h> using namespace std; using namespace GiNaC; int main(int argc, char** argv) { ex test = Li(5, exp(I*Pi/3)); cout << test << " = " << test.evalf() << endl; return 0; } gives Li(5,exp((1/3*I)*Pi)) = Li(5,exp((1/3*I)*Pi)) instead of expected Li(5,exp((1/3*I)*Pi)) = 0.48005914589970829926+0.89203268884598503196*I Attached patch seems to solve the problem. Best regards, Alexei.
Hi, On Thu, Sep 23, 2004 at 11:27:09AM +0400, Sheplyakov Alexei wrote:
gives
Li(5,exp((1/3*I)*Pi)) = Li(5,exp((1/3*I)*Pi))
instead of expected
Li(5,exp((1/3*I)*Pi)) = 0.48005914589970829926+0.89203268884598503196*I
Attached patch seems to solve the problem.
GiNaC functions do only return floating point numbers, if their arguments already contain floating point numbers. So actually in the example above everything is as expected. If you want a floating point result, you either have to call evalf() explicitly or write something like ...(1/3.0*I)*... Regards, Jens
participants (2)
-
Jens Vollinga
-
varg@thsun1.jinr.ru