# NextInt4

> Returns a uniformly random int4 value with all components in the interval [-2147483647, 2147483647].

## Definition

* **Type:** Method
* **Namespace:** [Unity.Mathematics](/engine/6000.6/script-reference/unity/mathematics.md)
* **Assembly:** UnityEngine.MathematicsModule

## NextInt4()

Returns a uniformly random int4 value with all components in the interval \[-2147483647, 2147483647].

```csharp
public int4 NextInt4()
```

### Returns

| Type                                                              | Description                    |
| ----------------------------------------------------------------- | ------------------------------ |
| [int4](/engine/6000.6/script-reference/unity/mathematics/int4.md) | A uniformly random int4 value. |

## NextInt4(int4)

Returns a uniformly random int4 value with all components in the interval \[0, max).

```csharp
public int4 NextInt4(int4 max)
```

### Parameters

**** (\[int4]\(/engine/6000.6/script-reference/unity/mathematics/int4)): The componentwise maximum value to generate, exclusive.

### Returns

| Type                                                              | Description                                                               |
| ----------------------------------------------------------------- | ------------------------------------------------------------------------- |
| [int4](/engine/6000.6/script-reference/unity/mathematics/int4.md) | A uniformly random int4 value with all components in the range \[0, max). |

## NextInt4(int4, int4)

Returns a uniformly random int4 value with all components in the interval \[min, max).

```csharp
public int4 NextInt4(int4 min, int4 max)
```

### Parameters

**** (\[int4]\(/engine/6000.6/script-reference/unity/mathematics/int4)): The componentwise minimum value to generate, inclusive.**** (\[int4]\(/engine/6000.6/script-reference/unity/mathematics/int4)): The componentwise maximum value to generate, exclusive.

### Returns

| Type                                                              | Description                                  |
| ----------------------------------------------------------------- | -------------------------------------------- |
| [int4](/engine/6000.6/script-reference/unity/mathematics/int4.md) | A uniformly random int4 between \[min, max). |
