Strange behavior of numer_denom

Christian Bauer Christian.Bauer at Uni-Mainz.DE
Mon Jun 30 20:07:58 CEST 2003


On Mon, Jun 30, 2003 at 10:07:36AM +0200, Roberto Bagnara wrote:
> There are two problems here: (1) the numerator and denominator returned
> are trivially not coprime;

numer_denom() and normal() have a problem with square roots that get
squared in the process, which I suspect is what happens here (1264 = 16*79).
Patches are welcome...

> and (2) numer_denom does not behave like a mathematical function. With the
> same input, it produces the sequence of answers
> {-1264*d,-1264}
> {1264*d,1264}
> [...]

The denominator should always be unit normal (= positive in this case).
This problem should now be fixed in CVS.


  / Physics is an algorithm

More information about the GiNaC-list mailing list