docs.unity.cn
    Show / Hide Table of Contents

    Method chgsign

    chgsign(Single, Single)

    Change the sign of x based on the most significant bit of y [msb(y) ? -x : x].

    Declaration
    public static float chgsign(float x, float y)
    Parameters
    Type Name Description
    Single x

    The single precision float to change the sign.

    Single y

    The single precision float used to test the most significant bit.

    Returns
    Type Description
    Single

    Returns x with changed sign based on y.

    chgsign(float2, float2)

    Change the sign of components of x based on the most significant bit of components of y [msb(y) ? -x : x].

    Declaration
    public static float2 chgsign(float2 x, float2 y)
    Parameters
    Type Name Description
    float2 x

    The single precision float vector to change the sign.

    float2 y

    The single precision float vector used to test the most significant bit.

    Returns
    Type Description
    float2

    Returns vector x with changed sign based on vector y.

    chgsign(float3, float3)

    Change the sign of components of x based on the most significant bit of components of y [msb(y) ? -x : x].

    Declaration
    public static float3 chgsign(float3 x, float3 y)
    Parameters
    Type Name Description
    float3 x

    The single precision float vector to change the sign.

    float3 y

    The single precision float vector used to test the most significant bit.

    Returns
    Type Description
    float3

    Returns vector x with changed sign based on vector y.

    chgsign(float4, float4)

    Change the sign of components of x based on the most significant bit of components of y [msb(y) ? -x : x].

    Declaration
    public static float4 chgsign(float4 x, float4 y)
    Parameters
    Type Name Description
    float4 x

    The single precision float vector to change the sign.

    float4 y

    The single precision float vector used to test the most significant bit.

    Returns
    Type Description
    float4

    Returns vector x with changed sign based on vector y.

    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