We are currently performing an upgrade to our software. This upgrade will bring MediaWiki from version 1.31 to 1.33. While the upgrade is being performed on your wiki it will be in read-only mode. For more information check here.

# UI/Frame Types/MathFrame

Jump to: navigation, search

# Math Frame

The MathFrame takes in two math values and an operator value. It then produces a result based on the inputs.

N/A

## Math Frame Properties

Math Frame inherits from Frame and shares all of its properties. Additionally it has:

A
The is the first value of a MathFrame.

B
The is the Second value of a MathFrame.

Operator
The is the Operator of a MathFrame. It is a required field for the frame to give a result.

It can have the following values: Add, Subtract, Multiply, Divide, Negate, Modulo, Absolute, Random

When calculating the results if the value of Operator is Add, Subtract, Multiply, Divide, or Modulo: it does A (Operator) B.

If the value is Negate, the result is -1 * A

If the value is Absolute, the result is the absolute value of A

If it's random, the result is a random value between A and B. This value will change only if the input values change.

Result
The is the result value of a MathFrame. This is a READ-ONLY value.

The Result is given as a decimal value.

ResultInt
The is the result value of a MathFrame. This is a READ-ONLY value.

The ResultInt is given as a Integer value.

ResultRound
The is the result value of a MathFrame. This is a READ-ONLY value.

The ResultRound is given as an integer value.

This is the value of Result rounded to the nearest integer value.

ResultCeil
The is the result value of a MathFrame. This is a READ-ONLY value.

The ResultCeil is given as an integer value.

This is the value of Result rounded up.

ResultValid
The is the result value of a MathFrame. This is a READ-ONLY value.

The ResultValid is given as a Boolean value.

This will be true if you are not dividing by 0 or B < A for a random generator.

## Examples

```<Frame type="MathFrame" name="YRatio">
<A val="{\$parent/YDistFrame/@Distance}"/>
<B val="100"/>
<Operator val="Divide"/>
<Handle val="YRatio"/>
</Frame>
```