# 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}
$$


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.intentable.io/intent-structure/computed-optional.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
