[GiNaC-list] Bug report

Vladimir V. Kisil kisilv at maths.leeds.ac.uk
Fri Aug 24 00:30:57 CEST 2018


	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.cebix.net/pipermail/ginac-list/attachments/20180823/88be018d/attachment.bin>


More information about the GiNaC-list mailing list