# 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>

```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
>
>
> says
>
> <blockquote>
> Although <cn>-37</cn> is valid, using minus is sometimes more clear.
>
> [itex]
> <apply> <minus/>
> <cn> 37 </cn>
> </apply>
> [/itex]
> </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 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:27:37 UTC