docs.unity.cn
    Show / Hide Table of Contents

    Method ispow2

    ispow2(Int32)

    Checks if the input is a power of two.

    Declaration
    public static bool ispow2(int x)
    Parameters
    Type Name Description
    Int32 x

    Integer input.

    Returns
    Type Description
    Boolean

    bool where true indicates that input was a power of two.

    Remarks

    If x is less than or equal to zero, then this function returns false.

    ispow2(int2)

    Checks if each component of the input is a power of two.

    Declaration
    public static bool2 ispow2(int2 x)
    Parameters
    Type Name Description
    int2 x

    int2 input

    Returns
    Type Description
    bool2

    bool2 where true in a component indicates the same component in the input was a power of two.

    Remarks

    If a component of x is less than or equal to zero, then this function returns false in that component.

    ispow2(int3)

    Checks if each component of the input is a power of two.

    Declaration
    public static bool3 ispow2(int3 x)
    Parameters
    Type Name Description
    int3 x

    int3 input

    Returns
    Type Description
    bool3

    bool3 where true in a component indicates the same component in the input was a power of two.

    Remarks

    If a component of x is less than or equal to zero, then this function returns false in that component.

    ispow2(int4)

    Checks if each component of the input is a power of two.

    Declaration
    public static bool4 ispow2(int4 x)
    Parameters
    Type Name Description
    int4 x

    int4 input

    Returns
    Type Description
    bool4

    bool4 where true in a component indicates the same component in the input was a power of two.

    Remarks

    If a component of x is less than or equal to zero, then this function returns false in that component.

    ispow2(UInt32)

    Checks if the input is a power of two.

    Declaration
    public static bool ispow2(uint x)
    Parameters
    Type Name Description
    UInt32 x

    Unsigned integer input.

    Returns
    Type Description
    Boolean

    bool where true indicates that input was a power of two.

    Remarks

    If x is less than or equal to zero, then this function returns false.

    ispow2(uint2)

    Checks if each component of the input is a power of two.

    Declaration
    public static bool2 ispow2(uint2 x)
    Parameters
    Type Name Description
    uint2 x

    uint2 input

    Returns
    Type Description
    bool2

    bool2 where true in a component indicates the same component in the input was a power of two.

    Remarks

    If a component of x is less than or equal to zero, then this function returns false in that component.

    ispow2(uint3)

    Checks if each component of the input is a power of two.

    Declaration
    public static bool3 ispow2(uint3 x)
    Parameters
    Type Name Description
    uint3 x

    uint3 input

    Returns
    Type Description
    bool3

    bool3 where true in a component indicates the same component in the input was a power of two.

    Remarks

    If a component of x is less than or equal to zero, then this function returns false in that component.

    ispow2(uint4)

    Checks if each component of the input is a power of two.

    Declaration
    public static bool4 ispow2(uint4 x)
    Parameters
    Type Name Description
    uint4 x

    uint4 input

    Returns
    Type Description
    bool4

    bool4 where true in a component indicates the same component in the input was a power of two.

    Remarks

    If a component of x is less than or equal to zero, then this function returns false in that component.

    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Tuesday, March 29, 2022
    Terms of use