{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Method CountBits | Collections | 2.3.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method CountBits

    CountBits(int, int)

    Returns the number of bits in a range that are 1.

    Declaration
    public readonly int CountBits(int pos, int numBits = 1)
    Parameters
    Type Name Description
    int pos

    Index of the bit at which to start searching.

    int numBits

    Number of bits to test. Defaults to 1.

    Returns
    Type Description
    int

    The number of bits in a range of bits that are 1.

    Exceptions
    Type Condition
    ArgumentException

    Thrown if pos is out of bounds or numBits is less than 1.

    In This Article
    Back to top
    Copyright © 2023 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)