# csum

> Returns the horizontal sum of components of an int2 vector.

## Definition

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

## csum(int2)

Returns the horizontal sum of components of an int2 vector.

```csharp
public static int csum(int2 x)
```

### Parameters

**** (\[int2]\(/engine/6000.7/script-reference/unity/mathematics/int2)): The vector to use when computing the horizontal sum.

### Returns

| Type                                                       | Description                                        |
| ---------------------------------------------------------- | -------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The horizontal sum of of components of the vector. |

## csum(int3)

Returns the horizontal sum of components of an int3 vector.

```csharp
public static int csum(int3 x)
```

### Parameters

**** (\[int3]\(/engine/6000.7/script-reference/unity/mathematics/int3)): The vector to use when computing the horizontal sum.

### Returns

| Type                                                       | Description                                        |
| ---------------------------------------------------------- | -------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The horizontal sum of of components of the vector. |

## csum(int4)

Returns the horizontal sum of components of an int4 vector.

```csharp
public static int csum(int4 x)
```

### Parameters

**** (\[int4]\(/engine/6000.7/script-reference/unity/mathematics/int4)): The vector to use when computing the horizontal sum.

### Returns

| Type                                                       | Description                                        |
| ---------------------------------------------------------- | -------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The horizontal sum of of components of the vector. |

## csum(uint2)

Returns the horizontal sum of components of a uint2 vector.

```csharp
public static uint csum(uint2 x)
```

### Parameters

**** (\[uint2]\(/engine/6000.7/script-reference/unity/mathematics/uint2)): The vector to use when computing the horizontal sum.

### Returns

| Type                                                         | Description                                        |
| ------------------------------------------------------------ | -------------------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | The horizontal sum of of components of the vector. |

## csum(uint3)

Returns the horizontal sum of components of a uint3 vector.

```csharp
public static uint csum(uint3 x)
```

### Parameters

**** (\[uint3]\(/engine/6000.7/script-reference/unity/mathematics/uint3)): The vector to use when computing the horizontal sum.

### Returns

| Type                                                         | Description                                        |
| ------------------------------------------------------------ | -------------------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | The horizontal sum of of components of the vector. |

## csum(uint4)

Returns the horizontal sum of components of a uint4 vector.

```csharp
public static uint csum(uint4 x)
```

### Parameters

**** (\[uint4]\(/engine/6000.7/script-reference/unity/mathematics/uint4)): The vector to use when computing the horizontal sum.

### Returns

| Type                                                         | Description                                        |
| ------------------------------------------------------------ | -------------------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | The horizontal sum of of components of the vector. |

## csum(float2)

Returns the horizontal sum of components of a float2 vector.

```csharp
public static float csum(float2 x)
```

### Parameters

**** (\[float2]\(/engine/6000.7/script-reference/unity/mathematics/float2)): The vector to use when computing the horizontal sum.

### Returns

| Type                                                          | Description                                        |
| ------------------------------------------------------------- | -------------------------------------------------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) | The horizontal sum of of components of the vector. |

## csum(float3)

Returns the horizontal sum of components of a float3 vector.

```csharp
public static float csum(float3 x)
```

### Parameters

**** (\[float3]\(/engine/6000.7/script-reference/unity/mathematics/float3)): The vector to use when computing the horizontal sum.

### Returns

| Type                                                          | Description                                        |
| ------------------------------------------------------------- | -------------------------------------------------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) | The horizontal sum of of components of the vector. |

## csum(float4)

Returns the horizontal sum of components of a float4 vector.

```csharp
public static float csum(float4 x)
```

### Parameters

**** (\[float4]\(/engine/6000.7/script-reference/unity/mathematics/float4)): The vector to use when computing the horizontal sum.

### Returns

| Type                                                          | Description                                        |
| ------------------------------------------------------------- | -------------------------------------------------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) | The horizontal sum of of components of the vector. |

## csum(double2)

Returns the horizontal sum of components of a double2 vector.

```csharp
public static double csum(double2 x)
```

### Parameters

**** (\[double2]\(/engine/6000.7/script-reference/unity/mathematics/double2)): The vector to use when computing the horizontal sum.

### Returns

| Type                                                           | Description                                        |
| -------------------------------------------------------------- | -------------------------------------------------- |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | The horizontal sum of of components of the vector. |

## csum(double3)

Returns the horizontal sum of components of a double3 vector.

```csharp
public static double csum(double3 x)
```

### Parameters

**** (\[double3]\(/engine/6000.7/script-reference/unity/mathematics/double3)): The vector to use when computing the horizontal sum.

### Returns

| Type                                                           | Description                                        |
| -------------------------------------------------------------- | -------------------------------------------------- |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | The horizontal sum of of components of the vector. |

## csum(double4)

Returns the horizontal sum of components of a double4 vector.

```csharp
public static double csum(double4 x)
```

### Parameters

**** (\[double4]\(/engine/6000.7/script-reference/unity/mathematics/double4)): The vector to use when computing the horizontal sum.

### Returns

| Type                                                           | Description                                        |
| -------------------------------------------------------------- | -------------------------------------------------- |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | The horizontal sum of of components of the vector. |
