docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method ispow2

    ispow2(int)

    Checks if the input is a power of two.

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

    Integer input.

    Returns
    Type Description
    bool

    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(uint)

    Checks if the input is a power of two.

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

    Unsigned integer input.

    Returns
    Type Description
    bool

    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.

    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)