# f32tof16

> Returns the result converting a float value to its nearest half-precision floating point representation.

## Definition

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

## f32tof16(float)

Returns the result converting a float value to its nearest half-precision floating point representation.

```csharp
public static uint f32tof16(float x)
```

### Parameters

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

### Returns

| Type                                                         | Description                                                            |
| ------------------------------------------------------------ | ---------------------------------------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | The half precision float representation of the single precision float. |

## f32tof16(float2)

Returns the result of a componentwise conversion of a float2 vector to its nearest half-precision floating point representation.

```csharp
public static uint2 f32tof16(float2 x)
```

### Parameters

**** (\[float2]\(/engine/6000.7/script-reference/unity/mathematics/float2)): The single precision float vector.

### Returns

| Type                                                                | Description                                                                          |
| ------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| [uint2](/engine/6000.7/script-reference/unity/mathematics/uint2.md) | The half precision float vector representation of the single precision float vector. |

## f32tof16(float3)

Returns the result of a componentwise conversion of a float3 vector to its nearest half-precision floating point representation.

```csharp
public static uint3 f32tof16(float3 x)
```

### Parameters

**** (\[float3]\(/engine/6000.7/script-reference/unity/mathematics/float3)): The single precision float vector.

### Returns

| Type                                                                | Description                                                                          |
| ------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| [uint3](/engine/6000.7/script-reference/unity/mathematics/uint3.md) | The half precision float vector representation of the single precision float vector. |

## f32tof16(float4)

Returns the result of a componentwise conversion of a float4 vector to its nearest half-precision floating point representation.

```csharp
public static uint4 f32tof16(float4 x)
```

### Parameters

**** (\[float4]\(/engine/6000.7/script-reference/unity/mathematics/float4)): The single precision float vector.

### Returns

| Type                                                                | Description                                                                          |
| ------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| [uint4](/engine/6000.7/script-reference/unity/mathematics/uint4.md) | The half precision float vector representation of the single precision float vector. |
