Hi Sebastien,
On Sun, 15 Jul 2012 09:25:35 -0700 (PDT)
Sebastien Gouezel <
sebastie...@gmail.com> wrote:
> I stumbled recently on a very minor bug in Sage: the output of
> latex(x^(2/3)) gives no parentheses around the exponent 2/3 (this
> seems to be a reasonable behavior), but in more complicated
> expressions like latex(x^(2/3)+1), parentheses are put around the
> exponent. Even worse, in latex(x^(2/3)+x^(-2/3)), there are
> parentheses around the positive exponent, but not around the negative
> one!
>
> I traced this to pynac, more precisely to the file ginac/power.cpp,
> line 204, which is currently "exponent.print(c, level)"
> This line shoud rather be exponent.print(c, 0), I see no reason why
> the level should be used in the printing of the exponent.
many thanks for tracking this down. I committed the patch already:
https://bitbucket.org/burcin/pynac/changeset/3fcc1e99171f
We should also open a ticket on the Sage tracker for doctest fixes.
Cheers,
Burcin