# Number functions

### Mathematical expressions

FlowScript supports algebraic expressions using common mathematical operators and parenthesized expressions. For example, the expression:

```
{x + 1}
```

...will print out as the value of variable *x* plus one (provided the variable *x* has a content which can be interpreted as a number).

Numeric literals (e.g. the 1 in the expression `{x + 1}`) can be positive or negative, integer or decimal. For decimals, always use the dot character, e.g. 1.5, whether or not your Flow environment is used in a language/region where the comma is used as the decimal separator. Note, however, that the numeric content of variables (as opposed to literals) is interpreted less restrictively; both the comma and the period can be used as a decimal separator. This ensures that Flow works with user-input values in regions using a decimal comma (such as Scandinavia) as well as regions using a decimal point (such as the US).

#### Mathematical operators <a href="#mathematical-operators" id="mathematical-operators"></a>

The following listing contains all the algebraic operators available in FlowScript.

**Plus (+)**

Adds two numbers. If the left side value (L) is a **date** and the right side value (R) is a **number**, the expression returns a new date representing L with R number of days added.

| Expression  | Result                                                                                                             |
| ----------- | ------------------------------------------------------------------------------------------------------------------ |
| `a + b`     | If *a* is a number, the sum of variables *a* and *b*; if *a* is a date, a new date representing *a* plus *b* days. |
| `now() + 1` | A date variable representing tomorrow.                                                                             |

**Minus (-)**

Subtracts two numbers. If the left side value (L) is a **date** and the right side value (R) is a **number**, the expression returns a new date representing L with R number of days subtracted.

| Expression  | Result                                                                                                                          |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `a - b`     | If *a* is a number, the difference between variables *a* and *b*; if *a* is a date, a new date representing *a* minus *b* days. |
| `now() - 1` | A date variable representing yesterday.                                                                                         |

**Multiplication and Division (\* /)**

Multiplies or divides two numbers.

| Expression    | Result                                  |
| ------------- | --------------------------------------- |
| `a * b`       | *a* multiplied by *b*                   |
| `a * 1.5 * b` | *a* multiplied by 1.5 multiplied by *b* |
| `a / 10`      | *a* divided by 10                       |
| a mod b       | The remainder after dividing *a* by *b* |


---

# 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://help.novacuraflow.com/development/flowscript/functions/number-functions.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.
