Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


f32tof16

Returns the result converting a float value to its nearest half-precision floating point representation.
Read time 1 minuteLast updated 12 days ago

Definition

f32tof16(float)

Returns the result converting a float value to its nearest half-precision floating point representation.
public static uint f32tof16(float x)

Parameters

The single precision float.

Returns

Type

Description

uintThe 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.
public static uint2 f32tof16(float2 x)

Parameters

The single precision float vector.

Returns

Type

Description

uint2The 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.
public static uint3 f32tof16(float3 x)

Parameters

The single precision float vector.

Returns

Type

Description

uint3The 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.
public static uint4 f32tof16(float4 x)

Parameters

The single precision float vector.

Returns

Type

Description

uint4The half precision float vector representation of the single precision float vector.