# CreateUiDefinition math functions

The functions enable you to perform math operations.

Adds two numbers, and returns the result.

The following example returns `3`:

``````"[add(1, 2)]"
``````

## ceil

Returns the largest integer greater than or equal to the specified number.

The following example returns `4`:

``````"[ceil(3.14)]"
``````

## div

Divides the first number by the second number, and returns the result. The result is always an integer.

The following example returns `2`:

``````"[div(6, 3)]"
``````

## floor

Returns the largest integer less than or equal to the specified number.

The following example returns `3`:

``````"[floor(3.14)]"
``````

## max

Returns the larger of the two numbers.

The following example returns `2`:

``````"[max(1, 2)]"
``````

## min

Returns the smaller of the two numbers.

The following example returns `1`:

``````"[min(1, 2)]"
``````

## mod

Divides the first number by the second number, and returns the remainder.

The following example returns `0`:

``````"[mod(6, 3)]"
``````

The following example returns `2`:

``````"[mod(6, 4)]"
``````

## mul

Multiplies two numbers, and returns the result.

The following example returns `6`:

``````"[mul(2, 3)]"
``````

## rand

Returns a random integral number within the specified range. This function does not generate cryptographically secure random numbers.

The following example could return `42`:

``````"[rand(-100, 100)]"
``````

## range

Generates a sequence of integral numbers within the specified range.

The following example returns `[1,2,3]`:

``````"[range(1, 3)]"
``````

## sub

Subtracts the second number from the first number, and returns the result.

The following example returns `1`:

``````"[sub(3, 2)]"
``````