X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=ginac%2Finifcns.cpp;h=9ac5ceba882add64f91025c733c2abd20d7d3450;hb=67ce3e7263c01ffa9d6df8d31d4d5506776f3bf7;hp=28d54fed3e79924dffbd95c457add5ff2bbd662a;hpb=aa2485821e68ea5f627d5753b41245a4cbd62fe3;p=ginac.git diff --git a/ginac/inifcns.cpp b/ginac/inifcns.cpp index 28d54fed..9ac5ceba 100644 --- a/ginac/inifcns.cpp +++ b/ginac/inifcns.cpp @@ -273,6 +273,9 @@ static ex abs_eval(const ex & arg) if (arg.info(info_flags::nonnegative)) return arg; + if (arg.info(info_flags::negative) || (-arg).info(info_flags::nonnegative)) + return -arg; + if (is_ex_the_function(arg, abs)) return arg; @@ -953,7 +956,7 @@ static ex binomial_eval(const ex & x, const ex &y) return binomial(x, y).hold(); } -// At the moment the numeric evaluation of a binomail function always +// At the moment the numeric evaluation of a binomial function always // gives a real number, but if this would be implemented using the gamma // function, also complex conjugation should be changed (or rather, deleted). static ex binomial_conjugate(const ex & x, const ex & y)