---
metadata:
  - name: generator
    content: Diplodoc Platform v5.39.1
alternate:
  - https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/util.math.cycleRestrict.md
  - https://yandex.com/dev/jsapi-v2-1/doc/ru/v2-1/ref/reference/util.math.cycleRestrict.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/jsapi-v2-1/doc/en/llms.txt

# util.math.cycleRestrict

Static function.

Assigns a numeric value to the set range. The range of values is considered to be closed in a ring. If a value is outside one of the ends of the range, the extra is counted off around the circl from the other end.

**Returns** value can be limited.

```javascript
{ Number } util.math.cycleRestrict(value, min, max)
```

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`value`](#param-value)[*](*star) | — | Type: Number

Value can be limited. ||
|| [`min`](#param-min)[*](*star) | — | Type: Number

Minimum limit. ||
|| [`max`](#param-max)[*](*star) | — | Type: Number

Maximum limit. ||
|#

\* Mandatory parameter/option.

**Example:**

```javascript
// Returns 110
ymaps.util.math.cycleRestrict(-250, -180, 180);
// Returns 60
ymaps.util.math.cycleRestrict(-300, -180, 180);
// Returns -170
ymaps.util.math.cycleRestrict(190, -180, 180);
```

[*star]: Mandatory parameter/option.