docs.unity.cn
    Show / Hide Table of Contents

    Method f32tof16

    f32tof16(Single)

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

    Declaration
    public static uint f32tof16(float x)
    Parameters
    Type Name Description
    Single x

    The single precision float.

    Returns
    Type Description
    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.

    Declaration
    public static uint2 f32tof16(float2 x)
    Parameters
    Type Name Description
    float2 x

    The single precision float vector.

    Returns
    Type Description
    uint2

    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.

    Declaration
    public static uint3 f32tof16(float3 x)
    Parameters
    Type Name Description
    float3 x

    The single precision float vector.

    Returns
    Type Description
    uint3

    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.

    Declaration
    public static uint4 f32tof16(float4 x)
    Parameters
    Type Name Description
    float4 x

    The single precision float vector.

    Returns
    Type Description
    uint4

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

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023