> For the complete documentation index, see [llms.txt](https://guides.clickatell.com/flow/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guides.clickatell.com/flow/action-nodes/action-nodes-math.md).

# Calculate

The *Calculate* action node allows you to perform mathematical operations on flow variables.

You can use two types of mathematical operations:

* **Comparison:** Variables are compared against each other as per the expression -  if it matches, a "Yes" result is returned, if it doesn't match, a "No" result is returned.
* **Calculation:** The result of the expression is calculated and stored under a session variable \[\[actionName:result]]*.* In other words, if you want to refer to the result of this calculation in another node, \[\[actionName:result]] is the variable name you should use. If successfully calculated, a "Yes" result is returned, else a "No" result is returned.

<figure><img src="/files/hj2XL89tQFKEtkncMYhR" alt="" width="563"><figcaption><p>Setup of a Calculate node</p></figcaption></figure>

![Example flow containing Calculate node](/files/-MeiNCx8Y9pTBqlCRZUk)

### Examples

The table below describes examples of mathematical expressions you can define in Chat Flow. You can create expressions as simple or complex as required.&#x20;

| Description | Example                                                                                                               |                            |
| ----------- | --------------------------------------------------------------------------------------------------------------------- | -------------------------- |
| + - / \*    | Standard math calculations (add, subtract, divide, multiply)                                                          | a+b, a-b, a/b, a\*b        |
| = > < >= <= | Standard comparison operators (equals to, greater than, less than, greater than or equals to, less than or equals to) | a=b, a>b, a\<b, a>=b, a<=b |
| !=          | Not equal to comparison operator                                                                                      | a!=b                       |
