.. # split from OESystemFunctions.rst:327

.. include:: ../substitutions

.. oe:namespace:: OESystem

.. meta::
   :keywords: OEBitIsPowerOf2

.. oe:function:: OEBitIsPowerOf2

   .. oe:language:: c++ java csharp

      .. oe:api::

         bool OEBitIsPowerOf2(unsigned int bitmask,
                              const bool allowZero = false)

   .. oe:language:: python

      .. oe:api:: python

         OEBitIsPowerOf2(bitmask: int, allowZero: bool = False) -> bool

   Returns ``true`` if ``bitmask`` is a power of 2; otherwise, it returns ``false``.

   allowZero
      If this value is set to ``true``, 0 is considered a power of 2. The default
      is ``false``.
