From: Vladimir V. Kisil Date: Tue, 7 Feb 2023 21:42:09 +0000 (+0100) Subject: [PATCH] Fix wrong numeric info on transcendental functions. X-Git-Tag: release_1-8-6~2 X-Git-Url: https://ginac.de/ginac.git/static/gitweb.css/ginac.git?a=commitdiff_plain;h=f04b1642020867543dc89be6af68e6bef5928c79;p=ginac.git [PATCH] Fix wrong numeric info on transcendental functions. Although expression like cos(numeric(1, 2)) is not a symbolic, it neither is numeric in the sense of CLN library. Without this patch GiNaC crashes on expressions like cos(cos(ex(1)/ex(2))). Thanks to Weng Zhanyang for reporting this. --- diff --git a/ginac/inifcns_trans.cpp b/ginac/inifcns_trans.cpp index d9dd4a26..6d32abbb 100644 --- a/ginac/inifcns_trans.cpp +++ b/ginac/inifcns_trans.cpp @@ -149,7 +149,6 @@ static ex exp_power(const ex & x, const ex & a) static bool exp_info(const ex & x, unsigned inf) { switch (inf) { - case info_flags::numeric: case info_flags::expanded: case info_flags::real: return x.info(inf); @@ -389,7 +388,6 @@ static ex log_conjugate(const ex & x) static bool log_info(const ex & x, unsigned inf) { switch (inf) { - case info_flags::numeric: case info_flags::expanded: return x.info(inf); case info_flags::real: @@ -512,7 +510,6 @@ static ex sin_conjugate(const ex & x) static bool trig_info(const ex & x, unsigned inf) { switch (inf) { - case info_flags::numeric: case info_flags::expanded: case info_flags::real: return x.info(inf); @@ -834,7 +831,6 @@ static ex asin_conjugate(const ex & x) static bool asin_info(const ex & x, unsigned inf) { switch (inf) { - case info_flags::numeric: case info_flags::expanded: return x.info(inf); default: @@ -1039,7 +1035,6 @@ static ex atan_conjugate(const ex & x) static bool atan_info(const ex & x, unsigned inf) { switch (inf) { - case info_flags::numeric: case info_flags::expanded: case info_flags::real: return x.info(inf); @@ -1158,7 +1153,6 @@ static ex atan2_deriv(const ex & y, const ex & x, unsigned deriv_param) static bool atan2_info(const ex & y, const ex & x, unsigned inf) { switch (inf) { - case info_flags::numeric: case info_flags::expanded: case info_flags::real: return y.info(inf) && x.info(inf);