X-Git-Url: https://ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=ginac%2Finifcns_zeta.cpp;h=d7e29c061a69f1ee01585b8159721c822dd041c5;hb=eb36a2fcd5f2c121a249f6d54bd18b2138bf6c3c;hp=53eba05bb23107e1119b11568638da5ff954b15f;hpb=6bff4f32e5cbe9f7e51837f392a2d0bf0d5b721d;p=ginac.git diff --git a/ginac/inifcns_zeta.cpp b/ginac/inifcns_zeta.cpp index 53eba05b..d7e29c06 100644 --- a/ginac/inifcns_zeta.cpp +++ b/ginac/inifcns_zeta.cpp @@ -3,7 +3,7 @@ * Implementation of the Zeta-function and some related stuff. */ /* - * GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2002 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -50,27 +50,27 @@ static ex zeta1_evalf(const ex & x) static ex zeta1_eval(const ex & x) { if (x.info(info_flags::numeric)) { - numeric y = ex_to(x); + const numeric &y = ex_to(x); // trap integer arguments: if (y.is_integer()) { if (y.is_zero()) - return _ex_1_2(); - if (x.is_equal(_ex1())) + return _ex_1_2; + if (y.is_equal(_num1)) throw(std::domain_error("zeta(1): infinity")); - if (x.info(info_flags::posint)) { - if (x.info(info_flags::odd)) + if (y.info(info_flags::posint)) { + if (y.info(info_flags::odd)) return zeta(x).hold(); else - return abs(bernoulli(y))*pow(Pi,x)*pow(_num2(),y-_num1())/factorial(y); + return abs(bernoulli(y))*pow(Pi,y)*pow(_num2,y-_num1)/factorial(y); } else { - if (x.info(info_flags::odd)) - return -bernoulli(_num1()-y)/(_num1()-y); + if (y.info(info_flags::odd)) + return -bernoulli(_num1-y)/(_num1-y); else - return _num0(); + return _ex0; } } // zeta(float) - if (x.info(info_flags::numeric) && !x.info(info_flags::crational)) + if (y.info(info_flags::numeric) && !y.info(info_flags::crational)) return zeta1_evalf(x); } return zeta(x).hold(); @@ -80,7 +80,7 @@ static ex zeta1_deriv(const ex & x, unsigned deriv_param) { GINAC_ASSERT(deriv_param==0); - return zeta(_ex1(), x); + return zeta(_ex1, x); } const unsigned function_index_zeta1 =