> For the complete documentation index, see [llms.txt](https://docs.intentable.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.intentable.io/intent-structure/computed-optional.md).

# Computed (Optional)

## Typed Struct (EIP712)

```solidity
Computed(uint256 index,uint256 value,uint256 add,uint256 sub,uint256 pow,uint256 mul,uint256 div,uint256 mod)
```

## Params

| Name    | Type    |
| ------- | ------- |
| `index` | uint256 |
| `value` | uint256 |
| `add`   | uint256 |
| `sub`   | uint256 |
| `pow`   | uint256 |
| `mul`   | uint256 |
| `div`   | uint256 |
| `mod`   | uint256 |

### index

Sequential number.

{% hint style="warning" %}
In order to prevent loops, computed input value is not allowed from the result of a previous computed.
{% endhint %}

### var

Input variable.\
Can be any constant value or a variable (externa, returned data, etc), except computed variable with a lower or equal index.

{% hint style="success" %}
Computed can use the result of another computed as an input value.
{% endhint %}

{% hint style="success" %}
"var", "add", "sub", "mul", "div", ect. can hold simple numbers, variables, or computed values.
{% endhint %}

### Formula

$$
result = ((var + add - sub)^{pow} \* mul / div )\bmod{mod}
$$
