XSL-FO - WordML - XSLT

Arithmetic, algebra, and logic

(Excerpt from "The MathML Handbook" by Pavi Sandhu)

Several content elements represent common operators and functions used in arithmetic, algebra, and logic. For example, the plus, minus, divide, and times elements represent the basic arithmetic operations of addition, subtraction, division, and multiplication, respectively.

The power and root elements are used to represent taking a power or root. You can encode a fractional power using either of these elements, but the default rendering is typically different in each case. For example, you could encode the cube root of x using the power element as shown here (this element is followed by two child elements, the first of which represents the base and the second the power):

``````<apply>
<power/>
<ci>x</ci>
<cn type="rational">1<sep/>3</cn>
</apply>
``````

Alternatively, you can use the root element to encode the same expression. By default, this would be rendered with a radical sign around the base expression. The first element following the root element is the qualifier element degree, which specifies the kind of root. It must contain the number 2 for square roots, 3 for cube roots, and so on. If no degree element is specified, a default value of 2 is assumed. Here is the relevant markup:

``````<apply>
<root/>
<degree><cn>3</cn></degree>
<ci>x</ci>
</apply>
``````

Here are some other important content elements:

• The factorial element is used to represent the factorial of a number.
• The real and imaginary elements represent the real and imaginary parts of a complex number.
• The and, or, xor, and not elements represent the corresponding operators in Boolean logic.