From kisilv at maths.leeds.ac.uk Fri Aug 24 00:30:57 2018 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Thu, 23 Aug 2018 23:30:57 +0100 Subject: [GiNaC-devel] [GiNaC-list] Bug report In-Reply-To: <6409640d.2fd74.165653b8f20.Coremail.acrobat@mail.ustc.edu.cn> References: <6409640d.2fd74.165653b8f20.Coremail.acrobat@mail.ustc.edu.cn> Message-ID: <23524.1535063457@math-pc2069.leeds.ac.uk> Hi, >>>>> On Thu, 23 Aug 2018 13:22:06 +0800 (GMT+08:00), ?? <acrobat at mail.ustc.edu.cn> said: > Dear all, I use GiNaC to perform analytic calculation, but when I > try to use .numer() and .denom() methods, I get a wrong result. > 1. expr.numer()/expr.denom() is not always equal to the original > expression!!! 2. Using .numer_denom() method could always get the > correct answer. It is not actually a bug. Since a/b = (-a)/(-b), numer() and denom() are only defined up to a sign. Thus their separate evaluation may lead to expr.numer()/expr.denom() with the opposite sign to expr. I am proposing a patch to tutorial reminding that, Best wishes, Vladimir -- Vladimir V. Kisil http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://goo.gl/EaG2Vu Software: Geometry of cycles http://moebinv.sourceforge.net/ -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Explaining-in-tutorial-sign-ambiguity-for-numer-and-.patch Type: text/x-diff Size: 1447 bytes Desc: Patch diff URL: <http://www.ginac.de/pipermail/ginac-devel/attachments/20180823/88be018d/attachment.bin>