Difference between revisions of "Math.Arithmetic.Addition"

From Fōrmulæ wiki
Jump to: navigation, search
m (Edition)
m (Edition)
Line 98: Line 98:
 
| [[File:AdditionBefore.png]] Addition (before) || [[File:Addition8.png]]
 
| [[File:AdditionBefore.png]] Addition (before) || [[File:Addition8.png]]
 
|-
 
|-
| [[File:AdditionStrict.png]] Addition (forced) ||
+
| [[File:AdditionStrict.png]] Addition (forced) || [[File:Addition17.png]]
 
|-
 
|-
| [[File:AdditionBeforeStrict.png]] Addition (forced, before) ||
+
| [[File:AdditionBeforeStrict.png]] Addition (forced, before) || [[File:Addition18.png]]
 
|-
 
|-
 
| [[File:Minus.png]] Subtraction ||
 
| [[File:Minus.png]] Subtraction ||

Revision as of 09:44, 20 April 2016

It is the tag for the expression representing the mathematical addition.

Definition

It is the tag for the expression representing the mathematical addition.

Notice that the string concatenation uses other tag, this is String.Text.Concatenation

Notice that there is no subtraction expression. A subtraction is an addition operation where the sustraend is a negative expression, it is

Behavior

This expression must have at least two children.

Children names

The subexpressions should be named "Addend 1", "Addend 2", ... Notice that the first addends is 1 and it is not 0, which happens in some mathematical or computer science contexts.

Visualization

There could be different visualizations, being the most popular the infix one, that us, using the (+) symbol between each consecutive pair of addends

Other form of visualization could exist, like the prefix form and rarely the postfix form.

Edition

There could be several editions. The most obvious is: Given a selected expression, it is replaced by a new addition expression with two children, the first one is the expressions that was selected, and the second one is a new Null expression. The latter becomes the new selected expression.

Reduction

Ther could be several reductions, see below.

Known implementations

The Standard Arithmetic Package

Visualization

There is one visualization on this package. It is a infix one.

It aligns the horizontal baselines of the addends, and the vertical baseline is located in the middle of the width of the expression. See the following example:

MetricsAddition.png

Negative addends

If an addend is a Math.Arithmetic.Negative expression, and it is not the first child, the minus sign (-) is drawn instead or the plus (+) one. The visualization of the Math.Arithmetic.Negative expression is not invoked, but its child's visualization is instead invoked, this is, the visualization of the unique child of the Math.Arithmetic.Negative expression. In the following example the middle addend is a Math.Arithmetic.Negative expression. The minus sign (-) was drawn by the Math.Arithmetic.Addition expression not the Math.Arithmetic.Negative one.

Addition1.png

Parentheses awareness

This visualization awares whether some of its children belong to the parentheses category Parentheses as operator. In such that case, these children are drawn between parentheses.

In the following example, the second addend is also an addition. Because this expression also belongs to the parentheses category Parentheses as operator (see below), the parent addition shows its children addition between parentheses.

Addition2.png

Parentheses categories

This visualization belongs to the category Parentheses as operator. It means that if this visualization is a child of a parent visualization that awares of this, that such parent expression will show this child between parentheses.

In the following example, the Math.Arithmetic.Negative visualization awares of its unique child to belong of that category, to show it between parentheses:

Negative8.png

This visualization belongs to the category Parentheses as super/subscripted. It means that if this visualization is a child of a parent visualization that awares of this, that such parent expression will show this child between parentheses.

In the following example, the Math.Arithmetic.Exponentiation visualization awares of either its base or exponent to belong of that category, to show either the base or the exponente between parentheses (in this case is the base):

Addition3.png

Edition

Example Edition performed Result
Addition4.png Addition.png Addition Addition8.png
AdditionBefore.png Addition (before) Addition10.png
AdditionStrict.png Addition (forced) Addition9.png
AdditionBeforeStrict.png Addition (forced, before) Addition11.png
Minus.png Subtraction Addition12.png
AdditionBefore.png Subtraction (before) Addition13.png
MinusStrict.png Subtraction (forced) Addition14.png
MinusBeforeStrict.png Subtraction (forced, before) Addition15.png
Addition5.png Addition.png Addition Addition16.png
AdditionBefore.png Addition (before) Addition8.png
AdditionStrict.png Addition (forced) Addition17.png
AdditionBeforeStrict.png Addition (forced, before) Addition18.png
Minus.png Subtraction
MinusBefore.png Subtraction (before)
MinusStrict.png Subtraction (forced)
MinusBeforeStrict.png Subtraction (forced, before)
Addition6.png Addition.png Addition
AdditionBefore.png Addition (before)
AdditionStrict.png Addition (forced)
AdditionBeforeStrict.png Addition (forced, before)
Minus.png Subtraction
MinusBefore.png Subtraction (before)
MinusStrict.png Subtraction (forced)
MinusBeforeStrict.png Subtraction (forced, before)
Addition7.png Addition.png Addition
AdditionBefore.png Addition (before)
AdditionStrict.png Addition (forced)
AdditionBeforeStrict.png Addition (forced, before)
Minus.png Subtraction
MinusBefore.png Subtraction (before)
MinusStrict.png Subtraction (forced)
MinusBeforeStrict.png Subtraction (forced, before)

Reduction