[GiNaC-list] real_part and imag_part

Vladimir V. Kisil kisilv at maths.leeds.ac.uk
Wed Aug 9 09:12:29 CEST 2017

>>>>> On Tue, 8 Aug 2017 20:15:07 +0200, Jan Rheinländer <jrheinlaender at gmx.de> said:

    JR> Hi, what is the logic here (example from ginsh)?

    >> real_part(sqrt(-3));
    JR> sqrt(-3)
    >> imag_part(sqrt(-3));
    JR> 0

    >> real_part(sqrt(-1));
    JR> 0
    >> imag_part(sqrt(-1));
    JR> 1

    The problems seems to be in CLN library, since for the
  GiNaC::numeric object sqrt(-3), real_part() and imag_part() are simply 
  calling cln::realpart() and cln::imagpart().
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/

More information about the GiNaC-list mailing list