W3C home > Mailing lists > Public > www-math@w3.org > May 2006

Re: How do I encode negative numbers in content MathML?

From: Michael Kohlhase <m.kohlhase@iu-bremen.de>
Date: Thu, 18 May 2006 19:44:01 +0200
Message-ID: <446CB261.8010506@iu-bremen.de>
To: juanrgonzaleza@canonicalscience.com
Cc: www-math@w3.org
Interesting that you should ask just now, I have been stumbling over the 
same thing a couple of days ago. The difference becomes interesting when 
you try to do presentation with bracket elision.

The general idea is that when we have

<apply>
  <or>
   <apply><and><ci>a</ci><ci>b</ci></apply>
   <apply><and><ci>c</ci><ci>d</ci></apply>
</apply>

which should give a /\ b \/ c /\ d since /\ binds more strongly than \/.

In such situations you want to have -(a+b), i.e. the unary minus 
operator needs brackets but -1, i.e. the unary minus operator does not 
here.

Michael

-------------------------------------------------------------------------
   Prof. Dr. Michael Kohlhase,         Office: Research 1, Room 62 
   Professor for Computer Science      Campus Ring 12, 
   School of Engineering & Science     D-28758 Bremen, Germany
   International University Bremen     tel/fax: +49 421 200-3140/-493140
   http://www.faculty.iu-bremen.de/mkohlhase <m.kohlhase@iu-bremen.de>          
--------------------------------------------------------------------------



juanrgonzaleza@canonicalscience.com wrote:
> The chapter 4 of MathML 2.0 specification is far from precise at this point.
>
> Moreover, the tutorial
>
> [http://cnx.org/content/m9008/latest/]
>
> recommends next code
>
> 	  <m:math>
> 	    <m:apply>
> 	      <m:minus/>
> 	      <m:ci>x</m:ci>
> 	    </m:apply>
> 	  </m:math>
>
> to representing the negative of a variable, and recommends
>
> <m:math><m:cn>-1</m:cn></m:math>
>
> for the negative of a number.
>
> Whereas the next MathML tutorial
>
> [http://www.pragma-ade.com/general/manuals/mmlprime.pdf]
>
> says
>
> <blockquote>
> Although <cn>-37</cn> is valid, using minus is sometimes more clear.
>
> <math>
> <apply> <minus/>
> <cn> 37 </cn>
> </apply>
> </math>
> </blockquote>
>
> What is the difference if any between both encodings?
>
> What may be preferred? (I personally prefer unary usage of <minus/>)
>
>
> Juan R.
>
> Center for CANONICAL |SCIENCE)
>
>
>
>
>   

Received on Thursday, 18 May 2006 17:44:15 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 20 February 2010 06:12:58 GMT