# abs

> Returns the absolute value of a int value.

## Definition

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

## abs(int)

Returns the absolute value of a int value.

```csharp
public static int abs(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 absolute value of the input. |

## abs(int2)

Returns the componentwise absolute value of a int2 vector.

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

### Parameters

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

### Returns

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

## abs(int3)

Returns the componentwise absolute value of a int3 vector.

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

### Parameters

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

### Returns

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

## abs(int4)

Returns the componentwise absolute value of a int4 vector.

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

### Parameters

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

### Returns

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

## abs(long)

Returns the absolute value of a long value.

```csharp
public static long abs(long x)
```

### Parameters

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

### Returns

| Type                                                        | Description                      |
| ----------------------------------------------------------- | -------------------------------- |
| [long](https://learn.microsoft.com/dotnet/api/system.int64) | The absolute value of the input. |

## abs(float)

Returns the absolute value of a float value.

```csharp
public static float abs(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 absolute value of the input. |

## abs(float2)

Returns the componentwise absolute value of a float2 vector.

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

### Parameters

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

### Returns

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

## abs(float3)

Returns the componentwise absolute value of a float3 vector.

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

### Parameters

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

### Returns

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

## abs(float4)

Returns the componentwise absolute value of a float4 vector.

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

### Parameters

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

### Returns

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

## abs(double)

Returns the absolute value of a double value.

```csharp
public static double abs(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 absolute value of the input. |

## abs(double2)

Returns the componentwise absolute value of a double2 vector.

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

### Parameters

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

### Returns

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

## abs(double3)

Returns the componentwise absolute value of a double3 vector.

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

### Parameters

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

### Returns

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

## abs(double4)

Returns the componentwise absolute value of a double4 vector.

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

### Parameters

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

### Returns

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