# step

> Returns the result of a step function where the result is 1.0f when x \>= threshold and 0.0f otherwise.

## Definition

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

## step(float, float)

Returns the result of a step function where the result is 1.0f when x \\>= threshold and 0.0f otherwise.

```csharp
public static float step(float threshold, float x)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Value to be used as a threshold for returning 1.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Value to compare against threshold.

### Returns

| Type                                                          | Description                                                |
| ------------------------------------------------------------- | ---------------------------------------------------------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) | 1 if the comparison x \\>= threshold is true, otherwise 0. |

## step(float2, float2)

Returns the result of a componentwise step function where each component is 1.0f when x \\>= threshold and 0.0f otherwise.

```csharp
public static float2 step(float2 threshold, float2 x)
```

### Parameters

**** (\[float2]\(/engine/6000.6/script-reference/unity/mathematics/float2)): Vector of values to be used as a threshold for returning 1.**** (\[float2]\(/engine/6000.6/script-reference/unity/mathematics/float2)): Vector of values to compare against threshold.

### Returns

| Type                                                                  | Description                                                              |
| --------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| [float2](/engine/6000.6/script-reference/unity/mathematics/float2.md) | 1 if the componentwise comparison x \\>= threshold is true, otherwise 0. |

## step(float3, float3)

Returns the result of a componentwise step function where each component is 1.0f when x \\>= threshold and 0.0f otherwise.

```csharp
public static float3 step(float3 threshold, float3 x)
```

### Parameters

**** (\[float3]\(/engine/6000.6/script-reference/unity/mathematics/float3)): Vector of values to be used as a threshold for returning 1.**** (\[float3]\(/engine/6000.6/script-reference/unity/mathematics/float3)): Vector of values to compare against threshold.

### Returns

| Type                                                                  | Description                                                              |
| --------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| [float3](/engine/6000.6/script-reference/unity/mathematics/float3.md) | 1 if the componentwise comparison x \\>= threshold is true, otherwise 0. |

## step(float4, float4)

Returns the result of a componentwise step function where each component is 1.0f when x \\>= threshold and 0.0f otherwise.

```csharp
public static float4 step(float4 threshold, float4 x)
```

### Parameters

**** (\[float4]\(/engine/6000.6/script-reference/unity/mathematics/float4)): Vector of values to be used as a threshold for returning 1.**** (\[float4]\(/engine/6000.6/script-reference/unity/mathematics/float4)): Vector of values to compare against threshold.

### Returns

| Type                                                                  | Description                                                              |
| --------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| [float4](/engine/6000.6/script-reference/unity/mathematics/float4.md) | 1 if the componentwise comparison x \\>= threshold is true, otherwise 0. |

## step(double, double)

Returns the result of a step function where the result is 1.0f when x \\>= threshold and 0.0f otherwise.

```csharp
public static double step(double threshold, double x)
```

### Parameters

**** (\[double]\(https\://learn.microsoft.com/dotnet/api/system.double)): Values to be used as a threshold for returning 1.**** (\[double]\(https\://learn.microsoft.com/dotnet/api/system.double)): Value to compare against threshold.

### Returns

| Type                                                           | Description                                                |
| -------------------------------------------------------------- | ---------------------------------------------------------- |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | 1 if the comparison x \\>= threshold is true, otherwise 0. |

## step(double2, double2)

Returns the result of a componentwise step function where each component is 1.0f when x \\>= threshold and 0.0f otherwise.

```csharp
public static double2 step(double2 threshold, double2 x)
```

### Parameters

**** (\[double2]\(/engine/6000.6/script-reference/unity/mathematics/double2)): Vector of values to be used as a threshold for returning 1.**** (\[double2]\(/engine/6000.6/script-reference/unity/mathematics/double2)): Vector of values to compare against threshold.

### Returns

| Type                                                                    | Description                                                              |
| ----------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| [double2](/engine/6000.6/script-reference/unity/mathematics/double2.md) | 1 if the componentwise comparison x \\>= threshold is true, otherwise 0. |

## step(double3, double3)

Returns the result of a componentwise step function where each component is 1.0f when x \\>= threshold and 0.0f otherwise.

```csharp
public static double3 step(double3 threshold, double3 x)
```

### Parameters

**** (\[double3]\(/engine/6000.6/script-reference/unity/mathematics/double3)): Vector of values to be used as a threshold for returning 1.**** (\[double3]\(/engine/6000.6/script-reference/unity/mathematics/double3)): Vector of values to compare against threshold.

### Returns

| Type                                                                    | Description                                                              |
| ----------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| [double3](/engine/6000.6/script-reference/unity/mathematics/double3.md) | 1 if the componentwise comparison x \\>= threshold is true, otherwise 0. |

## step(double4, double4)

Returns the result of a componentwise step function where each component is 1.0f when x \\>= threshold and 0.0f otherwise.

```csharp
public static double4 step(double4 threshold, double4 x)
```

### Parameters

**** (\[double4]\(/engine/6000.6/script-reference/unity/mathematics/double4)): Vector of values to be used as a threshold for returning 1.**** (\[double4]\(/engine/6000.6/script-reference/unity/mathematics/double4)): Vector of values to compare against threshold.

### Returns

| Type                                                                    | Description                                                              |
| ----------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| [double4](/engine/6000.6/script-reference/unity/mathematics/double4.md) | 1 if the componentwise comparison x \\>= threshold is true, otherwise 0. |
