MathML - Long Division


Advertisements

<mlongdiv> tag is used to draw long divisions.

Syntax

Here is the simple syntax to use this tag −

<mlongdiv> divisor dividend result expression </mlongdiv>

Parameters

Here is the description of all the parameters of this tag −

  • divisor − divisor of the long division.

  • dividend − dividend of the long division.

  • result − result of the long division.

  • expression − mstack element or children of mstack.

Attributes

Here is the description of all the attributes of this tag −

  • longdivstyle − to control the style of the long division layout. Valid values are lefttop, stackedrightright, mediumstackedrightright, shortstackedrightright, righttop, left/\right, left)(right, :right=right, stackedleftleft, stackedleftlinetop. Default is lefttop.

Example

Let's draw a simple fraction for 1/x.

<math xmlns = "http://www.w3.org/1998/Math/MathML">
   <mlongdiv longdivstyle = "lefttop">
      <mn> 3 </mn>
      <mn> 435.3</mn>
      <mn> 1306</mn>
      <msgroup position = "2" shift = "-1">
         <msgroup>
            <mn> 12</mn>
            <msline length = "2"/>
         </msgroup>
         
         <msgroup>
            <mn> 10</mn>
            <mn> 9</mn>
            <msline length = "2"/>
         </msgroup>
         
         <msgroup>
            <mn> 16</mn>
            <mn> 15</mn>
            <msline length = "2"/>
            <mn> 1.0</mn>           
         </msgroup>   
         
         <msgroup position='-1'>   
            <mn> 9</mn>
            <msline length = "3"/>
            <mn> 1</mn>
         </msgroup>
      </msgroup>
   </mlongdiv>
</math>

Output

3 435.3 1306 12 10 9 16 15 1.0 9 1
Advertisements