docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method chgsign

    chgsign(float, float)

    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
    float x

    The single precision float to change the sign.

    float y

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

    Returns
    Type Description
    float

    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.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)