]> MathML 3 Elementary Math Sample Page

# MathML 3 Elementary Math Sample Page

To properly see the MathML examples on this page, you need a browser capable of displaying the elementary math notations specified by MathML 3.

## Addition, Subtraction, and Multiplication Problems

Here's a simple addition problem that spaces the "+" away from the operand by using the element `none`:

 $496+28$ ```   496   + 28   ```

Here a more complicated subtraction problem that shows carries and borrows and crossouts:

 $212,327-1,1561,171$ ```                 2         1         2,327   - 1,156     1,171 ```

Notice that the carry/borrow default of "n" (north/above) is changed to the "nw" (northwest) position by `mscarries`, but that is overridden for the borrow and changed back to "n". The carry/borrow can be in any compass position. Several different styles for crossouts are possible.

Here's a multiplication problem that shows multiple rows of carries:

 $113435×251218587410925$   1   1 3   435   × 25     1   2185   874     10925

There are a few things to note about this example:

• we specified spacing between the characters on the `mstack` tag; absolute values such as "10px" can also be given
• the carries are shifted over; we could also have used an `msrow` and `none`, but specifying a position is simpler
• the '874' uses `msrow` to shift the number over one column, but a "0" could have been added and this would not have been needed; alternatively, msgroup with shift="1" could have been used, similar to what is done in the long division problem below

## Long Division

There are many different styles of long division used around the world. MathML has ten named styles, but the list is open ended. All styles share how the intermediate steps are displayed, but differ in the placement of the divisor, result, and where lines are drawn. The default style is the style used in the U.S., Great Britain, and elsewhere.

Below are two examples that differ only in the style and what character is used for the decimal separator. Because the separator is typically set on the ``` math``` element, it is included in these examples.

 $1216.51981278726.06.00$ ```   12   16.5   198             12                     78       72             6.0       6.0                     0       [/itex] ``` $1216,51981278726,06,00$ ```   12   16,5   198             12                     78       72             6,0       6,0                     0       [/itex]```

## Repeating Decimal

There are two common styles for indicating a repeating decimal in a decimal expansion of fractions like ⅓. The most common style puts a line above the part that repeats and the other style puts dots on the first and last digits of the part that repeats. Both are easy to write as shown below:

 $0.4047619$ ```     0.4047619 ``` $..0.4047619$ ```   . .   0.4047619 ```