Display problem in the plot window

Bug #66402 reported by David Boucher
4
Affects Status Importance Assigned to Milestone
gNumExp
Fix Committed
Undecided
Unassigned

Bug Description

I wanted to plot the function x/abs[x]. Because of a bug in the convertions between integers and reals I couldn't. But now, if you work with the last CVS version of numexp-core, you can.

But, the legend shows something strange that mixes the two notations : abs(x) and |x|.

I don't see how to join an image of what I get... but you can ask me... :-)

Revision history for this message
David Boucher (bouda1) wrote :

So here is the picture I get.

Revision history for this message
Gustavo Carneiro (gjc) wrote :

This is a numexp-core problem:

::> eval[mathml[x/abs[x]]]
ans = "<mrow><mfrac><mi>x</mi><mrow><mi>abs</mi><mo>⁡</mo><mo>(</mo><mi>x</mi><mo>)</mo></mrow></mfrac></mrow>"

Changed in gnumexp:
status: Unconfirmed → Confirmed
Revision history for this message
Alberto Simões (ambs) wrote :

This is not a numexp-core bug but a mathml rendering bug. The problem is that the two parts of the parenthesis are being drawn too closely on the small abs[x], thus producing that effect.

Although I am changing the mathml notation for abs I think this will happen for others functions, like sine or cosine.

Gustavo, please change this bug to gNumExp again (can't find the option anywhere).

Thanks
Alberto

Revision history for this message
Gustavo Carneiro (gjc) wrote :

The expression 'abs[x]' is being converted to the MathML:

<mrow><mi>abs</mi><mo>⁡</mo><mo>(</mo><mi>x</mi><mo>)</mo></mrow>

(where '⁡' is &ApplyFunction;)
This is not correct, should be
<mrow><mi>abs</mi><mo>&ApplyFunction;</mo><mrow><mo>(</mo><mi>x</mi><mo>)</mo></mrow></mrow>

That is, ( and ) should be start and end of an mrow of its own, for purposes of correct vertical stretching.

So there is a small bug in numexp-core at least.

Besides that, I simply cannot reproduce David's problem here. I only see abs(x) in the rendered MathML, I don't see (|x|).

Revision history for this message
Alberto Simões (ambs) wrote : Re: [Bug 66402] Re: Display problem in the plot window

Fixed in numexp-core

Gustavo Carneiro wrote:
> The expression 'abs[x]' is being converted to the MathML:
>
> <mrow><mi>abs</mi><mo>⁡</mo><mo>(</mo><mi>x</mi><mo>)</mo></mrow>
>
> (where '⁡' is &ApplyFunction;)
> This is not correct, should be
> <mrow><mi>abs</mi><mo>&ApplyFunction;</mo><mrow><mo>(</mo><mi>x</mi><mo>)</mo></mrow></mrow>
>
> That is, ( and ) should be start and end of an mrow of its own, for
> purposes of correct vertical stretching.
>
> So there is a small bug in numexp-core at least.
>
> Besides that, I simply cannot reproduce David's problem here. I only
> see abs(x) in the rendered MathML, I don't see (|x|).
>

--
Alberto Simões - Departamento de Informática - Universidade do Minho
                  Campus de Gualtar - 4710-057 Braga - Portugal

"Beware of bugs in the above code;
  I have only proved it correct, not tried it."
                                    --- Donald Knuth

Revision history for this message
Gustavo Carneiro (gjc) wrote :

Fixed in numexp-core and gnumexp; they both had their share of bugs :P

Changed in gnumexp:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.