# explicit operator half2

> Explicitly converts a single float value to a half2 vector by converting it to half and assigning it to every component.

## Definition

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

## explicit operator half2(half)

Explicitly converts a single float value to a half2 vector by converting it to half and assigning it to every component.

```csharp
public static explicit operator half2(float v)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): float to convert to half2

### Returns

| Type                                                                | Description      |
| ------------------------------------------------------------------- | ---------------- |
| [half2](/engine/6000.5/script-reference/unity/mathematics/half2.md) | Converted value. |

## explicit operator half2(half)

Explicitly converts a float2 vector to a half2 vector by componentwise conversion.

```csharp
public static explicit operator half2(float2 v)
```

### Parameters

**** (\[float2]\(/engine/6000.5/script-reference/unity/mathematics/float2)): float2 to convert to half2

### Returns

| Type                                                                | Description      |
| ------------------------------------------------------------------- | ---------------- |
| [half2](/engine/6000.5/script-reference/unity/mathematics/half2.md) | Converted value. |

## explicit operator half2(half)

Explicitly converts a single double value to a half2 vector by converting it to half and assigning it to every component.

```csharp
public static explicit operator half2(double v)
```

### Parameters

**** (\[double]\(https\://learn.microsoft.com/dotnet/api/system.double)): double to convert to half2

### Returns

| Type                                                                | Description      |
| ------------------------------------------------------------------- | ---------------- |
| [half2](/engine/6000.5/script-reference/unity/mathematics/half2.md) | Converted value. |

## explicit operator half2(half)

Explicitly converts a double2 vector to a half2 vector by componentwise conversion.

```csharp
public static explicit operator half2(double2 v)
```

### Parameters

**** (\[double2]\(/engine/6000.5/script-reference/unity/mathematics/double2)): double2 to convert to half2

### Returns

| Type                                                                | Description      |
| ------------------------------------------------------------------- | ---------------- |
| [half2](/engine/6000.5/script-reference/unity/mathematics/half2.md) | Converted value. |
