# sign

> Returns the sign of a int value. -1 if it is less than zero, 0 if it is zero and 1 if it greater than zero.

## Definition

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

## sign(int)

Returns the sign of a int value. -1 if it is less than zero, 0 if it is zero and 1 if it greater than zero.

```csharp
public static int sign(int x)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Input value.

### Returns

| Type                                                       | Description            |
| ---------------------------------------------------------- | ---------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The sign of the input. |

## sign(int2)

Returns the componentwise sign of a int2 value. 1 for positive components, 0 for zero components and -1 for negative components.

```csharp
public static int2 sign(int2 x)
```

### Parameters

**** (\[int2]\(/engine/6000.5/script-reference/unity/mathematics/int2)): Input value.

### Returns

| Type                                                              | Description                          |
| ----------------------------------------------------------------- | ------------------------------------ |
| [int2](/engine/6000.5/script-reference/unity/mathematics/int2.md) | The componentwise sign of the input. |

## sign(int3)

Returns the componentwise sign of a int3 value. 1 for positive components, 0 for zero components and -1 for negative components.

```csharp
public static int3 sign(int3 x)
```

### Parameters

**** (\[int3]\(/engine/6000.5/script-reference/unity/mathematics/int3)): Input value.

### Returns

| Type                                                              | Description                          |
| ----------------------------------------------------------------- | ------------------------------------ |
| [int3](/engine/6000.5/script-reference/unity/mathematics/int3.md) | The componentwise sign of the input. |

## sign(int4)

Returns the componentwise sign of a int4 value. 1 for positive components, 0 for zero components and -1 for negative components.

```csharp
public static int4 sign(int4 x)
```

### Parameters

**** (\[int4]\(/engine/6000.5/script-reference/unity/mathematics/int4)): Input value.

### Returns

| Type                                                              | Description                          |
| ----------------------------------------------------------------- | ------------------------------------ |
| [int4](/engine/6000.5/script-reference/unity/mathematics/int4.md) | The componentwise sign of the input. |

## sign(float)

Returns the sign of a float value. -1.0f if it is less than zero, 0.0f if it is zero and 1.0f if it greater than zero.

```csharp
public static float sign(float x)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Input value.

### Returns

| Type                                                          | Description            |
| ------------------------------------------------------------- | ---------------------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) | The sign of the input. |

## sign(float2)

Returns the componentwise sign of a float2 value. 1.0f for positive components, 0.0f for zero components and -1.0f for negative components.

```csharp
public static float2 sign(float2 x)
```

### Parameters

**** (\[float2]\(/engine/6000.5/script-reference/unity/mathematics/float2)): Input value.

### Returns

| Type                                                                  | Description                          |
| --------------------------------------------------------------------- | ------------------------------------ |
| [float2](/engine/6000.5/script-reference/unity/mathematics/float2.md) | The componentwise sign of the input. |

## sign(float3)

Returns the componentwise sign of a float3 value. 1.0f for positive components, 0.0f for zero components and -1.0f for negative components.

```csharp
public static float3 sign(float3 x)
```

### Parameters

**** (\[float3]\(/engine/6000.5/script-reference/unity/mathematics/float3)): Input value.

### Returns

| Type                                                                  | Description                          |
| --------------------------------------------------------------------- | ------------------------------------ |
| [float3](/engine/6000.5/script-reference/unity/mathematics/float3.md) | The componentwise sign of the input. |

## sign(float4)

Returns the componentwise sign of a float4 value. 1.0f for positive components, 0.0f for zero components and -1.0f for negative components.

```csharp
public static float4 sign(float4 x)
```

### Parameters

**** (\[float4]\(/engine/6000.5/script-reference/unity/mathematics/float4)): Input value.

### Returns

| Type                                                                  | Description                          |
| --------------------------------------------------------------------- | ------------------------------------ |
| [float4](/engine/6000.5/script-reference/unity/mathematics/float4.md) | The componentwise sign of the input. |

## sign(double)

Returns the sign of a double value. -1.0 if it is less than zero, 0.0 if it is zero and 1.0 if it greater than zero.

```csharp
public static double sign(double x)
```

### Parameters

**** (\[double]\(https\://learn.microsoft.com/dotnet/api/system.double)): Input value.

### Returns

| Type                                                           | Description            |
| -------------------------------------------------------------- | ---------------------- |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | The sign of the input. |

## sign(double2)

Returns the componentwise sign of a double2 value. 1.0 for positive components, 0.0 for zero components and -1.0 for negative components.

```csharp
public static double2 sign(double2 x)
```

### Parameters

**** (\[double2]\(/engine/6000.5/script-reference/unity/mathematics/double2)): Input value.

### Returns

| Type                                                                    | Description                          |
| ----------------------------------------------------------------------- | ------------------------------------ |
| [double2](/engine/6000.5/script-reference/unity/mathematics/double2.md) | The componentwise sign of the input. |

## sign(double3)

Returns the componentwise sign of a double3 value. 1.0 for positive components, 0.0 for zero components and -1.0 for negative components.

```csharp
public static double3 sign(double3 x)
```

### Parameters

**** (\[double3]\(/engine/6000.5/script-reference/unity/mathematics/double3)): Input value.

### Returns

| Type                                                                    | Description                          |
| ----------------------------------------------------------------------- | ------------------------------------ |
| [double3](/engine/6000.5/script-reference/unity/mathematics/double3.md) | The componentwise sign of the input. |

## sign(double4)

Returns the componentwise sign of a double4 value. 1.0 for positive components, 0.0 for zero components and -1.0 for negative components.

```csharp
public static double4 sign(double4 x)
```

### Parameters

**** (\[double4]\(/engine/6000.5/script-reference/unity/mathematics/double4)): Input value.

### Returns

| Type                                                                    | Description                          |
| ----------------------------------------------------------------------- | ------------------------------------ |
| [double4](/engine/6000.5/script-reference/unity/mathematics/double4.md) | The componentwise sign of the input. |
